public void LargestNumberAtLeastTwiceOfOthersTestMethod() { LargestNumberAtLeastTwiceOfOthers largestNumberAtLeastTwiceOfOthers = new LargestNumberAtLeastTwiceOfOthers(); //Assert.AreEqual(1,largestNumberAtLeastTwiceOfOthers.DominantIndex(new int[] { 3,6,1,0})); //Assert.AreEqual(-1,largestNumberAtLeastTwiceOfOthers.DominantIndex(new int[] { 1,2,3,4})); //Assert.AreEqual(3,largestNumberAtLeastTwiceOfOthers.DominantIndex(new int[] { 0,0,0,1})); Assert.AreEqual(0, largestNumberAtLeastTwiceOfOthers.DominantIndex(new int[] { 1 })); }
public void TestMethod1(int[] nums, int expected) { // Arrange LargestNumberAtLeastTwiceOfOthers question = new LargestNumberAtLeastTwiceOfOthers(); // Act int actual = question.DominantIndex(nums); // Assert Assert.AreEqual(expected, actual); }