예제 #1
0
        public void PlannerClass_GetPressureGroup_SelectedValuesAndEdgeCases()
        {
            // Depth lower than minimum on table
            Assert.AreEqual('A', _classUnderTest.GetPressureGroup(8, 10), "Unexpected value for 8,10");

            // Duration lower than minimum on table
            Assert.AreEqual('A', _classUnderTest.GetPressureGroup(10, 8), "Unexpected value for 10,8");

            // Duration AND depth lower than minimum on table
            Assert.AreEqual('A', _classUnderTest.GetPressureGroup(8, 8), "Unexpected value for 8,8");

            // Matches cell exactly
            Assert.AreEqual('A', _classUnderTest.GetPressureGroup(10, 10), "Unexpected value for 10,10");

            // Depth just over cell value
            Assert.AreEqual('B', _classUnderTest.GetPressureGroup(11, 11), "Unexpected value for 11,10");

            // Duration just over cell value
            Assert.AreEqual('B', _classUnderTest.GetPressureGroup(10, 11), "Unexpected value for 10,11");

            // Duration at maximum for depth
            Assert.AreEqual('Z', _classUnderTest.GetPressureGroup(10, 219), "Unexpected value for 10,219");

            // Duration above maximum for depth
            Assert.IsNull(_classUnderTest.GetPressureGroup(10, 220), "Unexpected value for 10,220");

            // Depth at Maximum for table
            Assert.AreEqual('B', _classUnderTest.GetPressureGroup(42, 4), "Unexpected value for 42,4");

            // Depth over Maximum for table
            Assert.IsNull(_classUnderTest.GetPressureGroup(43, 4), "Unexpected value for 43,4");

            // Duration and Depth over Maximum for table
            Assert.IsNull(_classUnderTest.GetPressureGroup(43, 9), "Unexpected value for 43,9");

            // Cell skips down to next depth
            Assert.AreEqual('B', _classUnderTest.GetPressureGroup(40, 1), "Unexpected value for 40,1");
            Assert.AreEqual('B', _classUnderTest.GetPressureGroup(42, 1), "Unexpected value for 42,1");
            Assert.AreEqual('D', _classUnderTest.GetPressureGroup(42, 5), "Unexpected value for 42,5");

            // can't test skip-down for 35 metres for 8.5 mins
            // can't test skip-down for 40 metres for 6.5 mins
        }