Skip to content
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
29 changes: 18 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,26 @@ jobs:
- checkout
- run:
name: Install dependencies
command: dotnet restore
- run:
name: Run tests with coverage
command: |
dotnet test tests/tests.sln \
--no-restore \
--verbosity normal \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage \
|| true
command: dotnet restore trolley.sln
- run:
name: Build
command: dotnet build --configuration Release --no-restore
command: dotnet build trolley.sln --configuration Release --no-restore
- run:
name: Discover tests
command: dotnet test tests/tests.sln --configuration Release --no-build --list-tests
- run:
name: Run integration tests with coverage
command: |
if [ -n "$TROLLEY_ACCESS_KEY" ] && [ -n "$TROLLEY_SECRET_KEY" ]; then
dotnet test tests/tests.sln \
--configuration Release \
--no-build \
--verbosity normal \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage
else
echo "Skipping integration tests because TROLLEY_ACCESS_KEY/TROLLEY_SECRET_KEY are not configured."
fi
- run:
name: Install GPG
command: apt-get update -qq && apt-get install -y gnupg
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,37 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
TROLLEY_ACCESS_KEY: ${{ secrets.TROLLEY_ACCESS_KEY }}
TROLLEY_SECRET_KEY: ${{ secrets.TROLLEY_SECRET_KEY }}
TROLLEY_API_BASE_URL: ${{ secrets.TROLLEY_API_BASE_URL }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore trolley/trolley.csproj
run: dotnet restore trolley.sln
- name: Build
run: dotnet build trolley/trolley.csproj --configuration Release --no-restore
- name: Test with coverage
continue-on-error: true
run: dotnet build trolley.sln --configuration Release --no-restore
- name: Discover tests
run: dotnet test tests/tests.sln --configuration Release --no-build --list-tests
- name: Run integration tests with coverage
if: env.TROLLEY_ACCESS_KEY != '' && env.TROLLEY_SECRET_KEY != ''
run: |
dotnet test tests/tests.sln \
--no-restore \
--configuration Release \
--no-build \
--verbosity normal \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage
- name: Skip integration tests without credentials
if: env.TROLLEY_ACCESS_KEY == '' || env.TROLLEY_SECRET_KEY == ''
run: echo "Skipping integration tests because TROLLEY_ACCESS_KEY/TROLLEY_SECRET_KEY are not configured."
- name: Upload coverage to Codecov
if: env.CODECOV_TOKEN != '' && env.TROLLEY_ACCESS_KEY != '' && env.TROLLEY_SECRET_KEY != ''
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
Binary file removed .vs/paymentrails/v14/.suo
Binary file not shown.

This file was deleted.

2 changes: 1 addition & 1 deletion tests/BalanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class BalanceTest
public void Init()
{
Config config = new Config();
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY);
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY, config.BASE_URL);
}

[TestMethod]
Expand Down
2 changes: 1 addition & 1 deletion tests/BatchTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public void Init()
{
Config config = new Config();
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY);
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY, config.BASE_URL);
}

private Recipient createRecipient()
Expand Down Expand Up @@ -163,7 +163,7 @@
Batch start = gateway.batch.ProcessBatch(batch.id);
Assert.IsNotNull(start);
}
catch (MalformedUrlException mfe)

Check warning on line 166 in tests/BatchTest.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'mfe' is declared but never used

Check warning on line 166 in tests/BatchTest.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'mfe' is declared but never used
{
//this test might fail because testing accounts will not have a valid payment plan
}
Expand Down
2 changes: 1 addition & 1 deletion tests/InvoiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class InvoiceTest
public void Init()
{
Config config = new Config();
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY);
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY, config.BASE_URL);
}

public TestContext TestContext
Expand Down
2 changes: 1 addition & 1 deletion tests/OfflinePaymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class OfflinePaymentTest
public void Init()
{
Config config = new Config();
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY);
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY, config.BASE_URL);
}

public TestContext TestContext
Expand Down
2 changes: 1 addition & 1 deletion tests/PaymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class PaymentTest
public void Init()
{
Config config = new Config();
trolley = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY);
trolley = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY, config.BASE_URL);
}

public TestContext TestContext
Expand Down
2 changes: 1 addition & 1 deletion tests/RecipientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RecipientTest
public void Init()
{
config = new Config();
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY);
gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY, config.BASE_URL);
}

[TestMethod]
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading