public void TestArrayWithOnlyTwoItem() { int[] dataArray = { 2, 8 }; int area = new ContainerWithMostWater().GetContainerWithMostWater(dataArray); Assert.AreEqual(2, area); }
public void NotEnoughLinesReturnsNegativeOne() { var container = new ContainerWithMostWater(); var lines = new[] { 1 }; Assert.Equal(-1, container.MaxArea(lines)); }
public void MaxArea_GivenAnIntArray_ReturnMaxArea(int[] array, int expectedResult) { var cwmw = new ContainerWithMostWater(); var result = cwmw.MaxArea(array); result.Should().Be(expectedResult); }
public void LargeArrayTimeOut_TwoPointer() { int[] input = GenerateVeryLargeArray(); const int expectedValue = 56250000; Assert.AreEqual(ContainerWithMostWater.MaxAreaTwoPointer(input), expectedValue); }
public void OnlyTwoLinesReturnsArea() { var container = new ContainerWithMostWater(); var lines = new[] { 1, 3 }; Assert.Equal(1, container.MaxArea(lines)); }
public void MaxArea(int[] height, int expected) { var sut = new ContainerWithMostWater(); var actual = sut.MaxArea(height); Assert.AreEqual(expected, actual); }
public void TestContainerWithMostWater() { var arr = new[] { 5, 7, 8, 1, 15, 3, 4 }; var r = ContainerWithMostWater.GetMax(arr); Assert.AreEqual(r, 60); }
public void ExampleInput_TwoPointer() { int[] input = new int[] { 1, 8, 6, 2, 5, 4, 8, 3, 7 }; const int expectedValue = 49; Assert.AreEqual(ContainerWithMostWater.MaxAreaTwoPointer(input), expectedValue); }
public void TestStandardCase() { int[] dataArray = { 1, 8, 6, 2, 5, 4, 8, 3, 7 }; int area = new ContainerWithMostWater().GetContainerWithMostWater(dataArray); Assert.AreEqual(49, area); }
public void Test_ContainerWithMostWater() { int[] input = { 1, 2, 4, 3 }; int result = ContainerWithMostWater.MaxArea(input); Assert.AreEqual(result, 4); }
public void MaxArea_Success() { var height = new int[] { 1, 8, 6, 2, 5, 4, 8, 3, 7 }; var expectedResult = 49; var result = new ContainerWithMostWater().MaxArea(height); Assert.AreEqual(result, expectedResult); }
public void SampleInputShouldReturn49() { var sw = new Stopwatch(); var container = new ContainerWithMostWater(); var lines = new[] { 1, 8, 6, 2, 5, 4, 8, 3, 7 }; Assert.Equal(49, container.MaxArea(lines)); }
public void Given_213_Then_4() { // Arrange var algo = new ContainerWithMostWater(); // Action var actual = algo.MaxArea(new int[] { 2, 1, 3 }); // Assert Assert.AreEqual(4, actual); }
public void Given_186254837_Then_49() { // Arrange var algo = new ContainerWithMostWater(); // Action var actual = algo.MaxArea(new int[] { 1, 8, 6, 2, 5, 4, 8, 3, 7 }); // Assert Assert.AreEqual(49, actual); }
public void ContainerWithMostWaterTest(int[] input, int expected) { var containerWithMostWater = new ContainerWithMostWater(); var actual = containerWithMostWater.MaxAreaNormalSolution(input); Assert.That(actual, Is.EqualTo(expected)); actual = containerWithMostWater.MaxAreaBetterSolution(input); Assert.That(actual, Is.EqualTo(expected)); }
public void MaxArea_ShouldReturn_MaximumAreaBetweenTwoLines( int[] heights, int expectedMaximumArea) { // Arrange var container = new ContainerWithMostWater(); // Act var maximumArea = container.MaxArea(heights); // Assert maximumArea.Should().Be(expectedMaximumArea); }
public ContainerWithMostWaterTests() { _objUnderTest = new ContainerWithMostWater(); }
public int ContainerWithMostWater(int[] height) { var solver = new ContainerWithMostWater(); return(solver.Solution(height)); }
public void MaxAreaTestCase1() { var input = new[] { 1, 8, 6, 2, 5, 4, 8, 3, 7 }; ContainerWithMostWater.MaxArea(input).Should().Be(49); }
public static void ArrayBased_ContainerWithMostWater_GetMaxAreaValues(int[] inputArray, int expectedMaxArea) { var outputMaxArea = ContainerWithMostWater.FindMaxArea(inputArray); Assert.Equal(expectedMaxArea, outputMaxArea); }
public void When_single_p_Then_hight() { var hight = new int[] { 5 }; Assert.AreEqual(0, ContainerWithMostWater.MaxArea(hight)); }
public void When_three_p_Then_max() { var hight = new int[] { 2, 5, 6 }; Assert.AreEqual(5, ContainerWithMostWater.MaxArea(hight)); }
public void When_two_p_Then_small_2() { var hight = new int[] { 5, 6 }; Assert.AreEqual(5, ContainerWithMostWater.MaxArea(hight)); }
public void MaxAreaTestCase3() { var input = new[] { 4, 3, 2, 1, 4 }; ContainerWithMostWater.MaxArea(input).Should().Be(16); }
public void MaxAreaTestCase5() { var input = new[] { 2, 1 }; ContainerWithMostWater.MaxArea(input).Should().Be(1); }
public void MaxAreaTestCase6() { var input = new[] { 2, 3, 4, 5, 18, 17, 6 }; ContainerWithMostWater.MaxArea(input).Should().Be(17); }
public void MaxAreaTestCase7() { var input = new[] { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; ContainerWithMostWater.MaxArea(input).Should().Be(25); }
void InternalTest(int[] height, int expected) { int value = ContainerWithMostWater.SmartMaxArea(height); Assert.Equal <int>(expected, value); }
public void BeforeEach() { ContainerWithMostWater = new ContainerWithMostWater(); }