diff --git a/ConsequencesTest/BoundingBoxTest.cs b/ConsequencesTest/BoundingBoxTest.cs index ce13de6..873b7a6 100644 --- a/ConsequencesTest/BoundingBoxTest.cs +++ b/ConsequencesTest/BoundingBoxTest.cs @@ -4,7 +4,7 @@ namespace ConsequencesTest; public class BoundingBoxTest { [Fact] - public void TestNSI() + public void NSIFormat_ArbitraryLocation_ReturnCorrectFormat() { Location upperLeft = new Location { X = -40, Y = 50 }; Location lowerRight = new Location { X = 60, Y = -50 }; diff --git a/ConsequencesTest/ConsoleWriterTest.cs b/ConsequencesTest/ConsoleWriterTest.cs index 8b56ede..5a292ba 100644 --- a/ConsequencesTest/ConsoleWriterTest.cs +++ b/ConsequencesTest/ConsoleWriterTest.cs @@ -10,7 +10,7 @@ public class ConsoleWrite static ResultItem[] resultItems = { r1, r2, r3 }; Result res = new Result(resultItems); [Fact] - public void TestHeaders() + public void Write_PrintsHeadersOnce() { string headers = "Depth,Velocity,ArrivalTime2ft\r\n"; string row1 = "1.03,2.02,1/1/0001 12:00:00 AM\r\n"; @@ -30,7 +30,7 @@ public void TestHeaders() } [Fact] - public void TestInvalidResult() + public void Write_InvalidRowWritten_ThrowsException() { // Result with headers that do not match res ResultItem[] bad = { r1, r1, r3 }; diff --git a/ConsequencesTest/DepthHazardTest.cs b/ConsequencesTest/DepthHazardTest.cs index 0a85407..b9578ef 100644 --- a/ConsequencesTest/DepthHazardTest.cs +++ b/ConsequencesTest/DepthHazardTest.cs @@ -7,13 +7,13 @@ public class DepthHazardTest IHazard dh = new DepthHazard(input); [Fact] - public void TestHasCorrectParameter() + public void Has_ValidParameter_ReturnsTrue() { Assert.True(dh.Has(HazardParameter.Depth)); } [Fact] - public void TestHasIncorrectParameter() + public void Has_InvalidParameter_ReturnsFalse() { Assert.False(dh.Has(HazardParameter.Velocity)); Assert.False(dh.Has(HazardParameter.ArrivalTime)); @@ -23,20 +23,20 @@ public void TestHasIncorrectParameter() } [Fact] - public void TestGetCorrectValue() + public void Get_ValidParameter_ReturnValue() { Assert.Equal(input, dh.Get(HazardParameter.Depth)); } [Fact] - public void TestGetIncorrectValue() + public void Get_ValidParameter_ValueNotEqualToRandom() { Assert.NotEqual(input + 0.1f, dh.Get(HazardParameter.Depth)); Assert.NotEqual(input * 1.23f, dh.Get(HazardParameter.Depth)); } [Fact] - public void TestGetInvalidParameter() + public void Get_InvalidParameter_ThrowNotSupported() { Assert.Throws(() => dh.Get(HazardParameter.ArrivalTime)); Assert.Throws(() => dh.Get(HazardParameter.Velocity)); @@ -44,7 +44,7 @@ public void TestGetInvalidParameter() } [Fact] - public void TestGetInvalidType() + public void Get_InvalidType_ThrowInvalidCast() { Assert.Throws(() => dh.Get(HazardParameter.Depth)); Assert.Throws(() => dh.Get(HazardParameter.Depth)); diff --git a/ConsequencesTest/LifeLossHazardTest.cs b/ConsequencesTest/LifeLossHazardTest.cs index a04ede0..d9a0fce 100644 --- a/ConsequencesTest/LifeLossHazardTest.cs +++ b/ConsequencesTest/LifeLossHazardTest.cs @@ -9,7 +9,7 @@ public class LifeLossHazardTest IHazard llh = new LifeLossHazard(depth, velocity, time); [Fact] - public void TestHasCorrectParameter() + public void Has_ValidParameter_ReturnsTrue() { Assert.True(llh.Has(HazardParameter.Depth)); Assert.True(llh.Has(HazardParameter.Velocity)); @@ -19,7 +19,7 @@ public void TestHasCorrectParameter() } [Fact] - public void TestHasIncorrectParameter() + public void Has_InvalidParameter_ReturnsFalse() { Assert.False(llh.Has(HazardParameter.ArrivalTime)); // compound parameter, must have all individual parameters to pass @@ -27,7 +27,7 @@ public void TestHasIncorrectParameter() } [Fact] - public void TestGetCorrectValue() + public void Get_ValidParameter_ReturnValue() { Assert.Equal(depth, llh.Get(HazardParameter.Depth)); Assert.Equal(velocity, llh.Get(HazardParameter.Velocity)); @@ -35,7 +35,7 @@ public void TestGetCorrectValue() } [Fact] - public void TestGetIncorrectValue() + public void Get_ValidParameter_ValueNotEqualToRandom() { Assert.NotEqual(depth + 0.1f, llh.Get(HazardParameter.Depth)); Assert.NotEqual(velocity + 0.1f, llh.Get(HazardParameter.Velocity)); @@ -43,14 +43,14 @@ public void TestGetIncorrectValue() } [Fact] - public void TestGetInvalidParameter() + public void Get_InvalidParameter_ThrowNotSupported() { Assert.Throws(() => llh.Get(HazardParameter.ArrivalTime)); Assert.Throws(() => llh.Get(HazardParameter.Velocity | HazardParameter.Depth)); } [Fact] - public void TestGetInvalidType() + public void Get_InvalidType_ThrowInvalidCast() { Assert.Throws(() => llh.Get(HazardParameter.Depth)); Assert.Throws(() => llh.Get(HazardParameter.Velocity)); diff --git a/ConsequencesTest/RandomDepthHazardProviderTest.cs b/ConsequencesTest/RandomDepthHazardProviderTest.cs index 7c25ab4..65e0299 100644 --- a/ConsequencesTest/RandomDepthHazardProviderTest.cs +++ b/ConsequencesTest/RandomDepthHazardProviderTest.cs @@ -5,7 +5,7 @@ namespace ConsequencesTest; public class RandomDepthHazardProviderTest { [Fact] - public void ExtentTest() + public void Extent_0000_CreateCorrectBox() { Location location1 = new Location { X = 0, Y = 0 }; Location location2 = new Location { X = 0, Y = 0 }; @@ -20,7 +20,7 @@ public void ExtentTest() } [Fact] - public void DepthTest() + public void Hazard_RandomDepthHazards_ConsistentDepthValues() { // seeded randomly generated depths to ensure consistency when testing int seed = 26; diff --git a/ConsequencesTest/StructureTest.cs b/ConsequencesTest/StructureTest.cs index a5f05b8..9e4b71b 100644 --- a/ConsequencesTest/StructureTest.cs +++ b/ConsequencesTest/StructureTest.cs @@ -7,7 +7,7 @@ namespace ConsequencesTest; public class StructureTest { [Fact] - public void TestSimpleDepth() + public void Compute_SimpleDepth() { Structure s = new Structure(); IHazard dh = new DepthHazard(4.56f); @@ -21,7 +21,7 @@ public void TestSimpleDepth() } [Fact] - public void TestDepthConsoleWriter() + public void Compute_ArrayDepth_CorrectConsoleOutput() { Structure s = new Structure(); DepthHazard[] depthHazardArray = @@ -63,7 +63,7 @@ public void TestDepthConsoleWriter() [Fact] - public void TestLifeLossConsoleWriter() + public void Compute_ArrayLifeLoss_CorrectConsoleOutput() { Structure s = new Structure(); LifeLossHazard[] lifeLossHazardArray =