public void MustFindMedianSortedArrays(int[] nums1, int[] nums2, double expected) { var sut = new MedianOfTwoSortedArrays(); var result = sut.FindMedianSortedArrays(nums1, nums2); result.Should().Be(expected); }
public void TestFindMedianOfTwoSortedArrays() { var sortedArray1 = new int[] { 1, 2, 3, 8, 10 }; var sortedArray2 = new int[] { 3, 4, 6, 7 }; var sortedArraySolver = new MedianOfTwoSortedArrays(); var median = sortedArraySolver.FindMedianOfTwoSortedArrays(sortedArray1, sortedArray2); }
public void Test_MedianOfTwoSortedArrays() { int[] num1 = new int[2] { 1, 2 }; int[] num2 = new int[2] { 3, 4 }; double output = MedianOfTwoSortedArrays.FindMedianSortedArrays(num1, num2); Assert.AreEqual(2.5, output); }
public void Common_Test() { // Arrange var solution = new MedianOfTwoSortedArrays(); var expected = 2; //act var result = solution.FindMedianSortedArrays(new[] { 1, 2, 3 }, new[] { 1, 2, 4, 5 }); //Assert Assert.Equal(expected, result); }
public void Median_odd_length() { Assert.Equal(5, MedianOfTwoSortedArrays.FindMedianSortedArray(new [] { 1, 2, 3, 4, 5, 6, 7, 8, 9 })); }
public void Array_rank(int[] nums, int x, int rank) { Assert.Equal(rank, MedianOfTwoSortedArrays.GetSortedArrayRank(x, nums)); }
public void MedianOfTwoSortedArrays() { MedianOfTwoSortedArrays MedianOfTwoSortedArrays = new MedianOfTwoSortedArrays(); MedianOfTwoSortedArrays.FindMedianSortedArrays(new int[] { 1, 3 }, new int[] { 2 }); }
public void FindMedianOfTwoSortedArraysTests_Returns_ExpectedResult(int[] nums1, int[] nums2, double expected) { var actual = MedianOfTwoSortedArrays.FindMedianSortedArrays(nums1, nums2); Assert.AreEqual(expected, actual); }
public MedianOfTwoSortedArraysTests() { _objUnderTest = new MedianOfTwoSortedArrays(); }
public void DataDrivenTest(int[] nums1, int[] nums2, int expectedMedian) { var sut = new MedianOfTwoSortedArrays(); double median = sut.FindMedianSortedArrays(nums1, nums2); }