Skip to content

Commit

Permalink
Merge pull request #65 from aspriddell/fix-tests
Browse files Browse the repository at this point in the history
Fix failing tests
  • Loading branch information
aspriddell authored Dec 4, 2021
2 parents d46767b + a94bfb1 commit 88a8488
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codequality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
run: dotnet restore

- name: InspectCode
timeout-minutes: 5
run: dotnet jb inspectcode ${{github.workspace}}/DragonFruit.Link.sln --output=${{github.workspace}}/inspectcodereport.xml --cachesDir=${{github.workspace}}/inspectcode --verbosity=WARN --no-build

- name: NVika
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"

- name: Unit Tests
run: dotnet test
env:
Expand Down
3 changes: 1 addition & 2 deletions DragonFruit.Link.Tests/DragonFruit.Link.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
6 changes: 5 additions & 1 deletion DragonFruit.Link.Tests/SteamApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ protected SteamApiTest()
? Environment.GetEnvironmentVariable(VariableName, EnvironmentVariableTarget.User) ?? Environment.GetEnvironmentVariable(VariableName, EnvironmentVariableTarget.Machine) ?? Environment.GetEnvironmentVariable(VariableName)
: Environment.GetEnvironmentVariable(VariableName));

protected static IEnumerable<ITestUser> Users => _testUsers ??= new ITestUser[] { new SteamCleanUser(), new SteamGameBannedUser() };
protected static IEnumerable<ITestUser> Users => _testUsers ??= new ITestUser[]
{
new SteamCleanUser(),
new SteamGameBannedUser()
};
}
}
14 changes: 7 additions & 7 deletions DragonFruit.Link.Tests/TestData/Users/GameBannedUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ namespace DragonFruit.Link.Tests.TestData.Users
{
public class SteamGameBannedUser : ITestUser
{
public ulong Id => Convert.ToUInt64("1100001001CF5F9", 16);
public ulong Id => Convert.ToUInt64("110000140F717BB", 16);

public string CustomUrlSegment => string.Empty;

public string Url => $"https://steamcommunity.com/profiles/{Id}";

public int MinBadges => 110;
public int MinBadges => 40;

public int MinLevel => 70;
public int MinLevel => 45;

public uint MinGames => 70;
public uint MinGames => 55;

public uint MinKillsCounterStrike => 2000;
public uint MinKillsCounterStrike => 1500;

public uint MinKillsTeamFortress => 600;
public uint MinKillsTeamFortress => 1;

public bool VACBanned => false;
public bool VACBanned => true;

public bool CommunityBanned => false;

Expand Down
2 changes: 1 addition & 1 deletion DragonFruit.Link.Tests/User/SteamUserGameStatsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void TestSteamGameStatsTeamFortress()
{
var stats = Client.GetUserGameStats(SteamApps.TeamFortress2, user.Id);

Assert.IsTrue(stats.Stats.Count() > 450);
Assert.IsTrue(stats.Stats.Count() > 100);
Assert.IsTrue(stats.Stats.Single(x => x.Name == "Scout.accum.iNumberOfKills").Value > user.MinKillsTeamFortress);
}
}
Expand Down

0 comments on commit 88a8488

Please sign in to comment.