Skip to content

Commit 92f8bd2

Browse files
Release 4.0.2
1 parent add376e commit 92f8bd2

File tree

94 files changed

+606
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+606
-565
lines changed

ApiClient.Tests/Api/ApiTest.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,28 @@ public class ApiTest
2222
protected const string SERVER_HEADER_VALUE_COMMA = "SMS,API";
2323
protected const string X_REQUEST_ID_HEADER_VALUE = "1608758729810312842";
2424

25-
protected Configuration? configuration;
25+
protected Configuration? Configuration;
2626

27-
protected WireMockServer? wireMockServer;
27+
protected WireMockServer? WireMockServer;
2828

2929
[TestInitialize]
3030
public void StartMockServer()
3131
{
3232
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
3333

34-
wireMockServer = WireMockServer.Start();
34+
WireMockServer = WireMockServer.Start();
3535

36-
configuration = new Configuration
36+
Configuration = new Configuration
3737
{
3838
ApiKey = API_KEY,
39-
BasePath = "http://localhost:" + wireMockServer.Ports[0]
39+
BasePath = "http://localhost:" + WireMockServer.Ports[0]
4040
};
4141
}
4242

4343
[TestCleanup]
4444
public void TearDown()
4545
{
46-
wireMockServer!.Stop();
46+
WireMockServer!.Stop();
4747
}
4848

4949
protected void SetUpGetRequest(string url, int statusCode, string expectedResponse,
@@ -57,7 +57,7 @@ protected void SetUpGetRequest(string url, int statusCode, string expectedRespon
5757
if (givenParameters != null && givenParameters.Count > 0)
5858
request = request.WithParam(EqualToParams(givenParameters));
5959

60-
wireMockServer!.Given(request)
60+
WireMockServer!.Given(request)
6161
.RespondWith(Response.Create()
6262
.WithStatusCode(statusCode)
6363
.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE)
@@ -77,7 +77,7 @@ protected void SetUpGetRequestBinary(string url, int statusCode, string expected
7777
if (givenParameters != null && givenParameters.Count > 0)
7878
request = request.WithParam(EqualToParams(givenParameters));
7979

80-
wireMockServer!.Given(request)
80+
WireMockServer!.Given(request)
8181
.RespondWith(Response.Create()
8282
.WithStatusCode(statusCode)
8383
.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE)
@@ -109,7 +109,7 @@ protected void SetUpPostRequest(string url, int statusCode, string? givenRequest
109109
response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE)
110110
.WithBody(expectedResponse);
111111

112-
wireMockServer!.Given(request).RespondWith(response);
112+
WireMockServer!.Given(request).RespondWith(response);
113113
}
114114

115115
protected void SetUpPatchRequest(string url, int statusCode, string givenRequest, string? expectedResponse = null,
@@ -134,7 +134,7 @@ protected void SetUpPatchRequest(string url, int statusCode, string givenRequest
134134
response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE)
135135
.WithBody(expectedResponse);
136136

137-
wireMockServer!.Given(request).RespondWith(response);
137+
WireMockServer!.Given(request).RespondWith(response);
138138
}
139139

140140
protected void SetUpPutRequest(string url, int statusCode, string givenRequest, string? expectedResponse = null,
@@ -159,7 +159,7 @@ protected void SetUpPutRequest(string url, int statusCode, string givenRequest,
159159
response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE)
160160
.WithBody(expectedResponse);
161161

162-
wireMockServer!.Given(request).RespondWith(response);
162+
WireMockServer!.Given(request).RespondWith(response);
163163
}
164164

165165
protected void SetUpDeleteRequest(string url, int statusCode, string? givenRequest = null,
@@ -184,7 +184,7 @@ protected void SetUpDeleteRequest(string url, int statusCode, string? givenReque
184184
response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE)
185185
.WithBody(expectedResponse);
186186

187-
wireMockServer!.Given(request).RespondWith(response);
187+
WireMockServer!.Given(request).RespondWith(response);
188188
}
189189

190190
protected void SetUpMultipartFormRequest(string url, Multimap<string, string> givenParts, string expectedResponse,
@@ -212,7 +212,7 @@ protected void SetUpMultipartFormRequest(string url, Multimap<string, string> gi
212212
.WithHeader("X-Request-Id", X_REQUEST_ID_HEADER_VALUE)
213213
.WithBody(expectedResponse);
214214

215-
wireMockServer!.Given(req).RespondWith(resp);
215+
WireMockServer!.Given(req).RespondWith(resp);
216216
}
217217

218218
private Func<IDictionary<string, WireMockList<string>>, bool>[] EqualToParams(Dictionary<string, string> parameters)

ApiClient.Tests/Api/CallRoutingApiTest.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Infobip.Api.Client.Api;
22
using Infobip.Api.Client.Model;
3-
using Microsoft.VisualStudio.TestTools.UnitTesting;
43
using Newtonsoft.Json;
54
using JsonSerializer = System.Text.Json.JsonSerializer;
65

@@ -115,7 +114,7 @@ public void ShouldGetCallRoutes()
115114

116115
SetUpGetRequest(CALL_ROUTING_ROUTES, 200, expectedResponse, givenQueryParameters);
117116

118-
var callRoutingApi = new CallRoutingApi(configuration);
117+
var callRoutingApi = new CallRoutingApi(Configuration);
119118

120119
void AssertCallRoutingRouteResponsePage(CallRoutingRouteResponsePage callRoutingRouteResponsePage)
121120
{
@@ -266,7 +265,7 @@ public void ShouldCreateCallRoute()
266265

267266
SetUpPostRequest(CALL_ROUTING_ROUTES, 201, givenRequest, expectedResponse);
268267

269-
var callRoutingApi = new CallRoutingApi(configuration);
268+
var callRoutingApi = new CallRoutingApi(Configuration);
270269

271270
var callroutingRouteRequest = new CallRoutingRouteRequest(
272271
givenName,
@@ -367,7 +366,7 @@ public void ShouldGetCallRoute()
367366

368367
SetUpGetRequest(CALL_ROUTING_ROUTE.Replace("{routeId}", givenRouteId), 200, expectedResponse);
369368

370-
var callRoutingApi = new CallRoutingApi(configuration);
369+
var callRoutingApi = new CallRoutingApi(Configuration);
371370

372371
void AssertCallRoutingRouteResponsePage(CallRoutingRouteResponse callRoutingRouteResponse)
373372
{
@@ -487,7 +486,7 @@ public void ShouldUpdateCallRoutes()
487486

488487
SetUpPutRequest(CALL_ROUTING_ROUTE.Replace("{routeId}", givenRouteId), 200, givenRequest, expectedResponse);
489488

490-
var callRoutingApi = new CallRoutingApi(configuration);
489+
var callRoutingApi = new CallRoutingApi(Configuration);
491490

492491
var callroutingRouteRequest = new CallRoutingRouteRequest(
493492
givenName,
@@ -591,7 +590,7 @@ public void ShouldDeleteCallRoutes()
591590
SetUpDeleteRequest(CALL_ROUTING_ROUTE.Replace("{routeId}", givenRouteId), 200,
592591
expectedResponse: exectedResponse, givenParameters: new Dictionary<string, string>());
593592

594-
var callRoutingApi = new CallRoutingApi(configuration);
593+
var callRoutingApi = new CallRoutingApi(Configuration);
595594

596595
void AssertCallRoutingRouteResponsePage(CallRoutingRouteResponse callRoutingRouteResponse)
597596
{
@@ -628,7 +627,7 @@ public void ShouldUrlDestinationWebhook()
628627
var expectedSipTrunkId = "60d345fd3a799ec";
629628
var expectedValueType = "SIP";
630629
var expectedConnectTimeout = 30;
631-
var expectedRecordingType = CallRoutingRecordingType.Audio;
630+
var expectedRecordingType = "AUDIO";
632631
var expectedType = "ENDPOINT";
633632

634633
var expectedResponse = $@"
@@ -689,7 +688,7 @@ void AssertCallRoutingEndpointDestinationResponse(
689688
Assert.AreEqual(expectedSipTrunkId, callRoutingSipEndpoint.SipTrunkId);
690689

691690
Assert.AreEqual(expectedConnectTimeout, callRoutingEndpointDestinationResponse.ConnectTimeout);
692-
Assert.AreEqual(expectedRecordingType, callRoutingEndpointDestinationResponse.Recording.RecordingType);
691+
Assert.AreEqual(expectedRecordingType, GetEnumAttributeValue(callRoutingEndpointDestinationResponse.Recording.RecordingType));
693692
}
694693

695694
void AssertCallRoutingUrlDestinationHttpRequest(

0 commit comments

Comments
 (0)