示例#1
0
        public void LessThree()
        {
            FrontTimes frontTimes = new FrontTimes();
            string     result     = frontTimes.GenerateString("abc", 3);

            Assert.AreEqual("abcabcabc", result);
        }
        public void FrontTimesabc()
        {
            FrontTimes frontString = new FrontTimes();
            string     myString    = frontString.GenerateString("abc", 3);

            Assert.AreEqual("abcabcabc", myString);
        }
示例#3
0
        public void ThreeLong()
        {
            FrontTimes frontTimes = new FrontTimes();
            string     result     = frontTimes.GenerateString("Chocolate", 3);

            Assert.AreEqual("ChoChoCho", result);
        }
        public void FrontTimes5a()
        {
            FrontTimes frontString = new FrontTimes();
            string     myString    = frontString.GenerateString("a", 5);

            Assert.AreEqual("aaaaa", myString);
        }
        public void FrontTimes210()
        {
            FrontTimes frontString = new FrontTimes();
            string     myString    = frontString.GenerateString("10", 2);

            Assert.AreEqual("1010", myString);
        }
        public void FrontTimesTestAbc3()
        {
            FrontTimes frontTimes = new FrontTimes();

            string actual = frontTimes.GenerateString("Abc", 3);

            Assert.AreEqual("AbcAbcAbc", actual);
        }
        public void FrontTimes(string str, int n, string expected)
        {
            FrontTimes ex = new FrontTimes();

            string actualResult = ex.GenerateString(str, n);

            Assert.AreEqual(expected, actualResult);
        }
示例#8
0
        public void GenerateString()
        {
            FrontTimes lae = new FrontTimes();

            Assert.AreEqual("ChoCho", lae.GenerateString("Chocolate", 2));
            Assert.AreEqual("ChoChoCho", lae.GenerateString("Chocolate", 3));
            Assert.AreEqual("AbcAbcAbc", lae.GenerateString("Abc", 3));
        }
        public void FrontTimesTestCho3()
        {
            FrontTimes frontTimes = new FrontTimes();

            string actual = frontTimes.GenerateString("Chocolate", 3);

            Assert.AreEqual("ChoChoCho", actual);
        }
示例#10
0
        public void Generating_String_And_Returning_Specific_Amount_Of_Times(string inputString, int timesRepeated, string expectedResult)
        {
            //Arrange
            FrontTimes checkString = new FrontTimes();
            // Act
            string actualResult = checkString.GenerateString(inputString, timesRepeated);

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
示例#11
0
        public void StringLessThan3Tests()
        {
            //Arrange
            FrontTimes exercise = new FrontTimes();

            //Assert
            Assert.AreEqual("JoJoJo", exercise.GenerateString("Jo", 3));
            Assert.AreEqual("JoJo", exercise.GenerateString("Jo", 2));
            Assert.AreEqual("Jo", exercise.GenerateString("Jo", 1));
        }
        public void EmptyStringIsOutputCorrect()
        {   //----Arrangle----------------------------------------
            FrontTimes emptyString = new FrontTimes();

            //----Act-----------------------------------------------
            string testString1 = emptyString.GenerateString("", 16);

            //----Assert-------------------------------------------
            Assert.AreEqual("", testString1);
        }
        public void DoesAStringAbcReturnAbcFiveTimes()
        {
            //Arrange
            FrontTimes shortString = new FrontTimes();
            //Act
            string result = shortString.GenerateString("Abc", 5);

            //Assert
            Assert.AreEqual("AbcAbcAbcAbcAbc", result);
        }
示例#14
0
        public void EmptyStringTests()
        {
            //Arrange
            FrontTimes exercise = new FrontTimes();

            //Assert
            Assert.AreEqual("", exercise.GenerateString("", 3));
            Assert.AreEqual("", exercise.GenerateString("", 2));
            Assert.AreEqual("", exercise.GenerateString("", 1));
        }
        public void DoesAStringChocolateReturnChoThreeTimes()
        {
            //Arrange
            FrontTimes shortString = new FrontTimes();
            //Act
            string result = shortString.GenerateString("Chocolate", 3);

            //Assert
            Assert.AreEqual("ChoChoCho", result);
        }
        public void OneCharIsOutputCorrect()
        {   //----Arrangle----------------------------------------
            FrontTimes oneChar = new FrontTimes();

            //----Act-----------------------------------------------
            string testString1 = oneChar.GenerateString("4", 16);

            //----Assert-------------------------------------------
            Assert.AreEqual("4444444444444444", testString1);
        }
        public void DoesAStringThreeReturnTwoTimes()
        {
            //Arrange
            FrontTimes shortString = new FrontTimes();
            //Act
            string result = shortString.GenerateString("3", 2);

            //Assert
            Assert.AreEqual("33", result);
        }
示例#18
0
        public void DataTestGenerateString(string input1, int input2, string expectedResult)
        {
            // Arrange
            FrontTimes ex = new FrontTimes();

            // Act
            string actualResult = ex.GenerateString(input1, input2);

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
        public void StringTestAbcAbcAbc()
        {
            FrontTimes frontTimes = new FrontTimes();
            string     input      = "Abc";
            int        input2     = 3;
            string     expected   = "AbcAbcAbc";
            string     result     = "";

            result = frontTimes.GenerateString(input, input2);
            Assert.AreEqual(expected, result);
        }
        public void StringTest()
        {
            FrontTimes frontTimes = new FrontTimes();
            string     input      = "Chocolate";
            int        input2     = 2;
            string     expected   = "ChoCho";
            string     result     = "";

            result = frontTimes.GenerateString(input, input2);
            Assert.AreEqual(expected, result);
        }
        public void ShouldReturnRepeatedFullStringWith1CharacterInput()
        {
            //arrange
            FrontTimes frontLoaded = new FrontTimes();

            //act
            string t6 = frontLoaded.GenerateString("t", 6);

            //assert
            Assert.AreEqual("tttttt", t6);
        }
示例#22
0
        public void GenerateString()
        {
            // Arrange
            FrontTimes ex = new FrontTimes();

            // Act
            string actualResult = ex.GenerateString("Chocolate", 2);

            // Assert
            Assert.AreEqual("ChoCho", actualResult);
        }
示例#23
0
        public void TestBadDataFrontTimes()
        {
            FrontTimes happyPath = new FrontTimes();

            string[] words      = { null, "No" };
            int[]    numOfTimes = { -1, 0, 1 };

            Assert.AreEqual("", happyPath.GenerateString(words[0], numOfTimes[0]));
            Assert.AreEqual("", happyPath.GenerateString(words[0], numOfTimes[2]));
            Assert.AreEqual("", happyPath.GenerateString(words[1], numOfTimes[1]));
        }
        public void ShouldReturnRepeatedFullStringWith3CharacterInput()
        {
            //arrange
            FrontTimes frontLoaded = new FrontTimes();

            //act
            string rat = frontLoaded.GenerateString("rat", 3);

            //assert
            Assert.AreEqual("ratratrat", rat);
        }
        public void GenerateStringTest()
        {
            var exercise = new FrontTimes();

            //frontTimes("Chocolate", 2) → "ChoCho"
            Assert.AreEqual("ChoCho", exercise.GenerateString("Chocolate", 2));
            //frontTimes("Chocolate", 3) → "ChoChoCho"
            Assert.AreEqual("ChoChoCho", exercise.GenerateString("Chocolate", 3));
            //frontTimes("Abc", 3) → "AbcAbcAbc"
            Assert.AreEqual("AbcAbcAbc", exercise.GenerateString("Abc", 3));
        }
        public void ShouldReturnFirst3CharactersWithLongerThan3CharacterInput()
        {
            //arrange
            FrontTimes frontLoaded = new FrontTimes();

            //act
            string goblin = frontLoaded.GenerateString("goblin", 4);

            //assert
            Assert.AreEqual("gobgobgobgob", goblin);
        }
示例#27
0
        public void GenerateStringVariables()
        {
            FrontTimes lae = new FrontTimes();

            Assert.AreEqual("MIAMIA", lae.GenerateString("MIAWMIAWMIAWMIAW", 2));
            Assert.AreEqual("", lae.GenerateString("", 3));
            Assert.AreEqual("AbAbAb", lae.GenerateString("Ab", 3));
            Assert.AreEqual("rrrrr", lae.GenerateString("r", 5));
            Assert.AreEqual("         ", lae.GenerateString("   ", 3));
            Assert.AreEqual("", lae.GenerateString("MIAWMIAWMIAWMIAW", 0));
        }
示例#28
0
        public void TestHappyPathFrontTimes()
        {
            FrontTimes happyPath = new FrontTimes();

            string[] words      = { "Chocolate", "Abc", "No" };
            int[]    numOfTimes = { 1, 2, 3 };

            Assert.AreEqual("Cho", happyPath.GenerateString(words[0], numOfTimes[0]));
            Assert.AreEqual("ChoCho", happyPath.GenerateString(words[0], numOfTimes[1]));
            Assert.AreEqual("Abc", happyPath.GenerateString(words[1], numOfTimes[0]));
            Assert.AreEqual("NoNoNo", happyPath.GenerateString(words[2], numOfTimes[2]));
        }
        public void ThreeOrMoreCharsIsOutputCorrect()
        {   //----Arrangle----------------------------------------
            FrontTimes threeOrMore = new FrontTimes();

            //----Act-----------------------------------------------
            string testString1 = threeOrMore.GenerateString("JayBizzle", 4);
            string testString2 = threeOrMore.GenerateString("bAt", 1);
            string testString3 = threeOrMore.GenerateString("Mr.Matt Hates Java", 2);

            //----Assert-------------------------------------------
            Assert.AreEqual("JayJayJayJay", testString1);
            Assert.AreEqual("bAt", testString2);
            Assert.AreEqual("Mr.Mr.", testString3);
        }
        public void TwoCharsIsOutputCorrect()
        {   //----Arrangle----------------------------------------
            FrontTimes twoChars = new FrontTimes();

            //----Act-----------------------------------------------
            string testString1 = twoChars.GenerateString("y0", 6);
            string testString2 = twoChars.GenerateString("??", 0);
            string testString3 = twoChars.GenerateString("HI", -2);

            //----Assert-------------------------------------------
            Assert.AreEqual("y0y0y0y0y0y0", testString1);
            Assert.AreEqual("", testString2);
            Assert.AreEqual("", testString3);
        }