Ejemplo n.º 1
0
        // [TestCase(10,new string[] { "1", "1", "3", "1", "2", "1", "3", "3", "3", "3" }, 4)]
        public void SockMerchantTest(int length, int[] arr, int expectedPairs)
        {
            SockMerchant obj    = new SockMerchant();
            var          result = obj.sockMerchant(length, arr);

            Assert.AreEqual(result, expectedPairs);
        }
Ejemplo n.º 2
0
    static void Main(string[] args)
    {
        Kangaroo kangaroo = new Kangaroo();

        kangaroo.Run();

        CamelCase camelCase = new CamelCase();

        camelCase.Run();

        StrongPassword strongPassword = new StrongPassword();

        strongPassword.Run();

        GradingStudents gradingStudents = new GradingStudents();

        gradingStudents.Run();

        IceCreamParlor iceCreamParlor = new IceCreamParlor();

        iceCreamParlor.Run();

        SockMerchant sockMerchant = new SockMerchant();

        sockMerchant.Run();

        RepeatedStrings repeatedStrings = new RepeatedStrings();

        repeatedStrings.Run();
    }
Ejemplo n.º 3
0
        public void Test_sockMerchant(int[] sockIdArray, int expectedPairCount)
        {
            //arrange
            var sut = new SockMerchant();

            //act
            var pairCount = sut.GetNumberOfPairs(sockIdArray.Length, sockIdArray);

            //assert
            pairCount.Should().Be(expectedPairCount);
        }
        public void sockMerchantTest3()
        {
            var ob = new SockMerchant();

            Assert.AreEqual(39, ob.sockMerchant(90, new int[]
            {
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20,
                10, 20, 20, 10, 10, 30, 50, 10, 20
            }));
        }
        public void sockMerchantTest1()
        {
            var ob = new SockMerchant();

            Assert.AreEqual(2, ob.sockMerchant(7, new int[] { 1, 2, 1, 2, 1, 3, 2 }));
        }
Ejemplo n.º 6
0
 static void UnSolved()
 {
     SockMerchant sockMerchant = new SockMerchant();
 }
Ejemplo n.º 7
0
        public void testSockProblem()
        {
            var pairs = SockMerchant.sockMerchant1(9, new int[] { 10, 20, 20, 10, 10, 30, 50, 10, 20 });

            Assert.AreEqual(3, pairs);
        }
Ejemplo n.º 8
0
 public void SockMerchantTest(int n, int[] ar, int expected)
 {
     Assert.Equal(expected, SockMerchant.Execute(n, ar));
 }