Code Cleanup: Integration Tests (#29584)
* Cleanup PuddleTest * Cleanup GravityGridTest * Cleanup PowerTest * Cleanup SaveLoadMapTest * Cleanup Body tests * Cleanup ContainerOcclusionTest * Cleanup AirlockTest * Cleanup DamageableTest * Cleanup EntityTest * Cleanup FluidSpillTest * Cleanup FollowerSystemTest * Cleanup HandCuffTest * Cleanup InteractionSystemTests * Cleanup InRangeUnobstructed * Cleanup SimplePredictReconcileTest * Cleanup PostMapInitTest * Cleanup SalvageTest * Cleanup SaveLoadSaveTest * Cleanup ShuttleTest * Cleanup MaterialArbitrageTest * Cleanup PrototypeSaveTest * Fix ShuttleTest * Bunch of small ones * Move JobTests to Station directory * More small fixes * Cleanup InteractionTest.Helpers Had to change a method signature, so some callers were modified too. * Missed one
This commit is contained in:
@@ -14,39 +14,39 @@ public sealed class DamageSpecifierTest
|
||||
// Test basic math operations.
|
||||
// I've already nearly broken these once. When editing the operators.
|
||||
|
||||
DamageSpecifier input1 = new() { DamageDict = _input1 };
|
||||
DamageSpecifier input2 = new() { DamageDict = _input2 };
|
||||
DamageSpecifier output1 = new() { DamageDict = _output1 };
|
||||
DamageSpecifier output2 = new() { DamageDict = _output2 };
|
||||
DamageSpecifier output3 = new() { DamageDict = _output3 };
|
||||
DamageSpecifier output4 = new() { DamageDict = _output4 };
|
||||
DamageSpecifier output5 = new() { DamageDict = _output5 };
|
||||
DamageSpecifier input1 = new() { DamageDict = Input1 };
|
||||
DamageSpecifier input2 = new() { DamageDict = Input2 };
|
||||
DamageSpecifier output1 = new() { DamageDict = Output1 };
|
||||
DamageSpecifier output2 = new() { DamageDict = Output2 };
|
||||
DamageSpecifier output3 = new() { DamageDict = Output3 };
|
||||
DamageSpecifier output4 = new() { DamageDict = Output4 };
|
||||
DamageSpecifier output5 = new() { DamageDict = Output5 };
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That((-input1).Equals(output1));
|
||||
Assert.That((input1 / 2).Equals(output2));
|
||||
Assert.That((input1 * 2).Equals(output3));
|
||||
Assert.That(-input1, Is.EqualTo(output1));
|
||||
Assert.That(input1 / 2, Is.EqualTo(output2));
|
||||
Assert.That(input1 * 2, Is.EqualTo(output3));
|
||||
});
|
||||
|
||||
var difference = (input1 - input2);
|
||||
Assert.That(difference.Equals(output4));
|
||||
var difference = input1 - input2;
|
||||
Assert.That(difference, Is.EqualTo(output4));
|
||||
|
||||
var difference2 = (-input2) + input1;
|
||||
Assert.That(difference.Equals(difference2));
|
||||
var difference2 = -input2 + input1;
|
||||
Assert.That(difference, Is.EqualTo(difference2));
|
||||
|
||||
difference.Clamp(-0.25f, 0.25f);
|
||||
Assert.That(difference.Equals(output5));
|
||||
Assert.That(difference, Is.EqualTo(output5));
|
||||
}
|
||||
|
||||
static Dictionary<string, FixedPoint2> _input1 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Input1 = new()
|
||||
{
|
||||
{ "A", 1.5f },
|
||||
{ "B", 2 },
|
||||
{ "C", 3 }
|
||||
};
|
||||
|
||||
static Dictionary<string, FixedPoint2> _input2 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Input2 = new()
|
||||
{
|
||||
{ "A", 1 },
|
||||
{ "B", 2 },
|
||||
@@ -54,28 +54,28 @@ public sealed class DamageSpecifierTest
|
||||
{ "D", 0.05f }
|
||||
};
|
||||
|
||||
static Dictionary<string, FixedPoint2> _output1 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Output1 = new()
|
||||
{
|
||||
{ "A", -1.5f },
|
||||
{ "B", -2 },
|
||||
{ "C", -3 }
|
||||
};
|
||||
|
||||
static Dictionary<string, FixedPoint2> _output2 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Output2 = new()
|
||||
{
|
||||
{ "A", 0.75f },
|
||||
{ "B", 1 },
|
||||
{ "C", 1.5 }
|
||||
};
|
||||
|
||||
static Dictionary<string, FixedPoint2> _output3 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Output3 = new()
|
||||
{
|
||||
{ "A", 3f },
|
||||
{ "B", 4 },
|
||||
{ "C", 6 }
|
||||
};
|
||||
|
||||
static Dictionary<string, FixedPoint2> _output4 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Output4 = new()
|
||||
{
|
||||
{ "A", 0.5f },
|
||||
{ "B", 0 },
|
||||
@@ -83,7 +83,7 @@ public sealed class DamageSpecifierTest
|
||||
{ "D", -0.05f }
|
||||
};
|
||||
|
||||
static Dictionary<string, FixedPoint2> _output5 = new()
|
||||
private static readonly Dictionary<string, FixedPoint2> Output5 = new()
|
||||
{
|
||||
{ "A", 0.25f },
|
||||
{ "B", 0 },
|
||||
|
||||
Reference in New Issue
Block a user