Fix test harness casing and exclude test sources from app
This commit is contained in:
@@ -18,7 +18,7 @@ public class AuthTests
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
var json = await response.Content.ReadFromJsonAsync<JsonElement>();
|
||||
Assert.True(json.GetProperty("IsAdmin").GetBoolean());
|
||||
Assert.True(json.GetProperty("isAdmin").GetBoolean());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ResultsTests
|
||||
|
||||
Assert.True(results.GetArrayLength() >= 1);
|
||||
var first = results[0];
|
||||
Assert.Equal("ResultGame", first.GetProperty("Name").GetString());
|
||||
Assert.Equal(8, (int)first.GetProperty("Average").GetDouble());
|
||||
Assert.Equal("ResultGame", first.GetProperty("name").GetString());
|
||||
Assert.Equal(8, (int)first.GetProperty("average").GetDouble());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class StateTests
|
||||
|
||||
var state = await player.GetFromJsonAsync<JsonElement>("/api/state");
|
||||
|
||||
Assert.Equal((int)Phase.Results, state.GetProperty("CurrentPhase").GetInt32());
|
||||
Assert.Equal(Phase.Results.ToString(), state.GetProperty("currentPhase").GetString());
|
||||
Assert.True(state.GetProperty("resultsOpen").GetBoolean());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ internal class StubHttpClientFactory : IHttpClientFactory
|
||||
|
||||
public HttpClient CreateClient(string name)
|
||||
{
|
||||
return new HttpClient(_handler, dispose: false);
|
||||
return new HttpClient(_handler, disposeHandler: false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ internal static class TestClientExtensions
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
var json = await response.Content.ReadFromJsonAsync<JsonElement>();
|
||||
return json.GetProperty("Id").GetInt32();
|
||||
return json.GetProperty("id").GetInt32();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,9 @@ public class VoteTests
|
||||
vote.EnsureSuccessStatusCode();
|
||||
|
||||
var mine = await player.GetFromJsonAsync<List<VoteRecord>>("/api/votes/mine");
|
||||
Assert.NotNull(mine);
|
||||
|
||||
Assert.Equal(2, mine.Count);
|
||||
Assert.Equal(2, mine!.Count);
|
||||
Assert.All(mine, v => Assert.Equal(9, v.Score));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user