public void SockMerchantTest()
        {
            int[] ar = new int[] { 10, 20, 20, 10, 10, 30, 50, 10, 20 };
            int   n  = ar.Length;

            int result = SalesByMatch.SockMerchant(n, ar);

            Assert.AreEqual(3, result);
        }
Exemple #2
0
        public void TestCase0()
        {
            //Arrange
            int arrayLength = 19;

            int[] arr = new int[9] {
                10, 20, 20, 10, 10, 30, 50, 10, 20
            };
            //Act
            var result = SalesByMatch.SockMerchant(arrayLength, arr);

            //Assert
            Assert.AreEqual(3, result);
        }
Exemple #3
0
        public void TestCase8()
        {
            //Arrange
            int arrayLength = 10;

            int[] arr = new int[10] {
                1, 1, 3, 1, 2, 1, 3, 3, 3, 3
            };
            //Act
            var result = SalesByMatch.SockMerchant(arrayLength, arr);

            //Assert
            Assert.AreEqual(4, result);
        }