public void TestMethodContainsDuplicate()
        {
            var test1 = new int[] { 1, 2, 3, 4, 5, 6, 7 };
            var test2 = new int[] { 1, 2, 3, 3, 4, 5, 6, 7 };

            Assert.AreEqual(false, ContainsDuplicateSolution.ContainsDuplicate(test1));
            Assert.AreEqual(true, ContainsDuplicateSolution.ContainsDuplicate(test2));
        }
Ejemplo n.º 2
0
        public void ContainsDuplicateTest(int[] nums, bool expected)
        {
            var actual = new ContainsDuplicateSolution().ContainsDuplicate(nums);

            Assert.Equal(expected, actual);
        }