Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWI-1632: [.NET] API Integration Tests #75

Merged
merged 8 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@ jobs:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN}}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN}}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
OPERATING_SYSTEM: ${{ matrix.os }}
CSHARP_VERSION: ${{ matrix.dotnet }}
run: dotnet test $BW_PROJECT_TEST_NAME
- name: Pack NuGet package
run: dotnet pack --configuration Release $BW_PROJECT_NAME -p:PackageVersion=$RELEASE_VERSION
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ jobs:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN}}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN}}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
OPERATING_SYSTEM: ${{ matrix.os }}
CSHARP_VERSION: ${{ matrix.dotnet }}
# Required for multiple target frameworks in the StandardTests project.
DOTNET: ${{ matrix.dotnet }}
run: dotnet test src/Bandwidth.Standard.Test
Expand Down
8 changes: 1 addition & 7 deletions src/Bandwidth.Standard.Test/Api/MFAApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
*/

using System;
using System.IO;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using Xunit;

using Bandwidth.Standard.Client;
Expand Down Expand Up @@ -91,7 +85,7 @@ public void GenerateVoiceCodeTest()
var response = instance.GenerateVoiceCodeWithHttpInfo(accountId, codeRequest);

Assert.IsType<ApiResponse<VoiceCodeResponse>>(response);
Assert.Equal(HttpStatusCode.OK, apiResponse.StatusCode);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Bandwidth.Standard.Test/Api/StatisticsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public StatisticsApiTests()
mockClient = new Mock<ISynchronousClient>();
mockAsynchronousClient = new Mock<IAsynchronousClient>();
fakeConfiguration = new Configuration();
fakeConfiguration.BasePath = "https://numbers.bandwidth.com/api/v1";
fakeConfiguration.BasePath = "https://voice.bandwidth.com/api/v2";
fakeConfiguration.Username = "username";
fakeConfiguration.Password = "password";
instance = new StatisticsApi(mockClient.Object, mockAsynchronousClient.Object, fakeConfiguration);
Expand Down
Loading
Loading