Esempio n. 1
0
        public void test10()
        {
            // Here the first three parameters have valid values so we don't care about Jesus
            string s = CSharpMethods.SuperRepeaty("Ko", true, 4, "Jesus");

            Assert.AreEqual("*KoKoKoKo*", s);
        }
Esempio n. 2
0
        public void test9()
        {
            // Similar as above
            string s = CSharpMethods.SuperRepeaty(null, true, 5, "Jesus");

            Assert.AreEqual("Jesus", s);
        }
Esempio n. 3
0
        public void test8()
        {
            // If a 4th parameter is used then you shouldn't give an ArgumentException
            // Instead return the 4th parameter
            string s = CSharpMethods.SuperRepeaty("Abc", true, -3, "Panda");

            Assert.AreEqual("Panda", s);
        }
Esempio n. 4
0
        public void test7()
        {
            // Here null is supplied so the method should give an ArgumentException

            Assert.ThrowsException <ArgumentException>(() =>
                                                       CSharpMethods.SuperRepeaty(null, true, 5)
                                                       );
        }
Esempio n. 5
0
        public void test6()
        {
            // Here a negative number is supplied so the method should give an ArgumentException

            Assert.ThrowsException <ArgumentException>(() =>
                                                       CSharpMethods.SuperRepeaty("Abc", true, -3)
                                                       );
        }
Esempio n. 6
0
        public void test5()
        {
            string s = CSharpMethods.Repeaty("", true, 0);

            Assert.AreEqual("**", s);
        }
Esempio n. 7
0
        public void test4()
        {
            string s = CSharpMethods.Repeaty("CAT", true, 1);

            Assert.AreEqual("*CAT*", s);
        }
Esempio n. 8
0
        public void test3()
        {
            string s = CSharpMethods.Repeaty("Abcde", true, 4);

            Assert.AreEqual("*AbcdeAbcdeAbcdeAbcde*", s);
        }
Esempio n. 9
0
        public void test2()
        {
            string s = CSharpMethods.Repeaty("Abcde", false, 4);

            Assert.AreEqual("AbcdeAbcdeAbcdeAbcde", s);
        }
Esempio n. 10
0
        public void test1()
        {
            string s = CSharpMethods.Repeaty("Xyz", false, 2);

            Assert.AreEqual("XyzXyz", s);
        }