Fix NUnit analyzer warnings in content.

This commit is contained in:
Pieter-Jan Briers
2020-07-30 23:38:35 +02:00
parent 681f1419c7
commit fca7d8d81a
5 changed files with 21 additions and 21 deletions

View File

@@ -60,7 +60,7 @@ namespace Content.IntegrationTests.Tests
Assert.False(ActionBlockerSystem.CanMove(human));
Assert.False(ActionBlockerSystem.CanChangeDirection(human));
Assert.False(EffectBlockerSystem.CanFall(human));
Assert.AreEqual(human.Transform.WorldPosition, chair.Transform.WorldPosition);
Assert.That(human.Transform.WorldPosition, Is.EqualTo(chair.Transform.WorldPosition));
// Side effects of buckling for the strap
Assert.That(strap.BuckledEntities, Does.Contain(human));

View File

@@ -44,7 +44,7 @@ namespace Content.IntegrationTests.Tests
Assert.That(generator.HasComponent<PowerReceiverComponent>());
var generatorComponent = generator.GetComponent<GravityGeneratorComponent>();
var powerComponent = generator.GetComponent<PowerReceiverComponent>();
Assert.AreEqual(generatorComponent.Status, GravityGeneratorStatus.Unpowered);
Assert.That(generatorComponent.Status, Is.EqualTo(GravityGeneratorStatus.Unpowered));
powerComponent.NeedsPower = false;
});
server.RunTicks(1);
@@ -53,7 +53,7 @@ namespace Content.IntegrationTests.Tests
{
var generatorComponent = generator.GetComponent<GravityGeneratorComponent>();
Assert.AreEqual(generatorComponent.Status, GravityGeneratorStatus.On);
Assert.That(generatorComponent.Status, Is.EqualTo(GravityGeneratorStatus.On));
Assert.That(!grid1.HasGravity);
Assert.That(grid2.HasGravity);

View File

@@ -55,15 +55,15 @@ namespace Content.IntegrationTests.Tests
if(!mapManager.TryFindGridAt(new MapId(10), new Vector2(10,10), out var mapGrid))
Assert.Fail();
Assert.AreEqual(new Vector2(10, 10), mapGrid.WorldPosition);
Assert.AreEqual(new Tile(1, 512), mapGrid.GetTileRef(new MapIndices(0, 0)).Tile);
Assert.That(mapGrid.WorldPosition, Is.EqualTo(new Vector2(10, 10)));
Assert.That(mapGrid.GetTileRef(new MapIndices(0, 0)).Tile, Is.EqualTo(new Tile(1, 512)));
}
{
if (!mapManager.TryFindGridAt(new MapId(10), new Vector2(-8, -8), out var mapGrid))
Assert.Fail();
Assert.AreEqual(new Vector2(-8, -8), mapGrid.WorldPosition);
Assert.AreEqual(new Tile(2, 511), mapGrid.GetTileRef(new MapIndices(0, 0)).Tile);
Assert.That(mapGrid.WorldPosition, Is.EqualTo(new Vector2(-8, -8)));
Assert.That(mapGrid.GetTileRef(new MapIndices(0, 0)).Tile, Is.EqualTo(new Tile(2, 511)));
}
}