Example #1
0
        public void Test002_GivenTitleCase_GetTitleCaseReturnsInputWithFirstLetterCapitalized()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Apple", titleCase.GetTitleCase("apple"));

            // The issue wasn't that I needed to add this second assert, but that I skipped the 'refactor' step of 'Red, Green, Refactor'
            // to eliminate the magic character
            Assert.AreEqual("Knife", titleCase.GetTitleCase("knife"));
        }
Example #2
0
        public void Test011_GivenTitleCase_GetTitleCaseReturnsCapitalisedFirstWordEvenWhenInputAndMinorWordsAreTheSameAndLowerCase()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Ab", titleCase.GetTitleCase("ab", "ab"));
        }
Example #3
0
        public void Test010_GivenTitleCase_GetTitleCaseWorksEvenIfALaterWordIsTheSameAsTheFirstWord()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("The Wind in the Willows", titleCase.GetTitleCase("the wind in the willows", "the in"));
        }
Example #4
0
        public void Test001_GivenTitleCase_GetTitleCaseReturnsInputString()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Apple", titleCase.GetTitleCase("Apple"));
        }
Example #5
0
        public void Test009_GivenTitleCase_GetTitleCaseWorksEvenIfFirstLetterOfWordIsUsedLaterInWord()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Wind in the Willows", titleCase.GetTitleCase("wind in the willows", "the in"));
        }
Example #6
0
        public void Test008_GivenTitleCase_GetTitleCaseMakesLowerCaseAllLettersAfterTheFirstInEachWord()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Wind in the Hills", titleCase.GetTitleCase("WIND IN THE HILLS", "The In"));
        }
Example #7
0
        public void Test007_GivenTitleCase_GetTitleCaseReturnsWithFirstWordCapitalizedEvenThoughItIsPresentInMinorWords()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("A Clash of Jesters", titleCase.GetTitleCase("a clash of jesters", "of a"));
        }
Example #8
0
        public void Test006_GivenTitleCase_GetTitleCaseReturnsInputWithFirstAndFourthWordsTitleCasedSecondAndThirdWordsLowerCase()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Gone with the Wind", titleCase.GetTitleCase("gone with the wind", "the with"));
        }
Example #9
0
        public void Test005_GivenTitleCase_GetTitleCaseReturnsInputWithFirstLettersOfTwoWordsCapitalized()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Apple Pie", titleCase.GetTitleCase("apple pie"));
        }
Example #10
0
        public void Test003_GivenTitleCase_GetTitleCaseReturnsInputWithFirstLetterLowerCaseDueToMinorWordsParameter()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("An apple", titleCase.GetTitleCase("an apple", "apple"));
        }
Example #11
0
        public void Test012_GivenTitleCase_GetTitleCaseTreatsNullMinorWordsParameterAsBlankString()
        {
            TitleCase titleCase = new TitleCase();

            Assert.AreEqual("Abc Def Ghi", titleCase.GetTitleCase("aBC deF Ghi", null));
        }
 public string GetTitleCase_Test(string minor, string original)
 {
     return(TitleCase.GetTitleCase(minor, original));
 }