Skip to content

Commit

Permalink
Added github runner
Browse files Browse the repository at this point in the history
  • Loading branch information
garioncox committed Feb 28, 2024
1 parent 399930f commit 08d8e93
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/TestRunner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test Runner
on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build
- name: Test with the dotnet CLI
run: dotnet test
1 change: 0 additions & 1 deletion KakeysBakery.Tests/AddOnTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace KakeysBakery.Tests;
public class AddOnTests : IClassFixture<BakeryFactory>
{
public HttpClient client { get; set; }
public BakeryFactory bakeryFactory { get; set; }
public AddOnTests(BakeryFactory Factory)
{
client = Factory.CreateDefaultClient();
Expand Down
3 changes: 2 additions & 1 deletion KakeysBakery.Tests/BaseGoodTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace KakeysBakery.Tests;
public class BaseGoodTests : IClassFixture<BakeryFactory>
{
public HttpClient client { get; set; }
public BakeryFactory bakeryFactory { get; set; }
public BaseGoodTests(BakeryFactory Factory)
{
client = Factory.CreateDefaultClient();
Expand Down Expand Up @@ -136,6 +135,8 @@ public async Task Edit_BaseGood()


// ASSERT
Assert.NotNull(result);

Assert.Equal(testBaseGood.Suggestedprice, result.Suggestedprice);
Assert.Equal(testBaseGood.Flavor, result.Flavor);
Assert.Equal(testBaseGood.Id, result.Id);
Expand Down
1 change: 0 additions & 1 deletion KakeysBakery.Tests/PurchaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace KakeysBakery.Tests;
public class PurchaseTests : IClassFixture<BakeryFactory>
{
public HttpClient client { get; set; }
public BakeryFactory bakeryFactory { get; set; }
public PurchaseTests(BakeryFactory Factory)
{
client = Factory.CreateDefaultClient();
Expand Down
2 changes: 1 addition & 1 deletion KakeysBakery/Services/AddOnService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task DeleteAddOnAsync(int addonID)
{
try
{
Addon addon = await _context.Addons.FirstOrDefaultAsync(a => a.Id == addonID);
Addon? addon = await _context.Addons.FirstOrDefaultAsync(a => a.Id == addonID);
if (addon != null)
{
_context.Addons.Remove(addon);
Expand Down
2 changes: 1 addition & 1 deletion KakeysBakery/Services/BaseGoodService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Task DeleteBaseGoodAsync(int baseGoodId)
{
try
{
Basegood basegood = _context.Basegoods.FirstOrDefault(b => b.Id == baseGoodId);
Basegood? basegood = _context.Basegoods.FirstOrDefault(b => b.Id == baseGoodId);
if (basegood != null)
{
_context.Basegoods.Remove(basegood);
Expand Down

0 comments on commit 08d8e93

Please sign in to comment.