public void HaveLyrics()
        {
            var animalCollection = new List <string> {
                "fly",
                "spider",
                "bird",
                "cat",
                "dog",
                "cow",
                "horse"
            };
            var rhymeList = new List <AnimalRhyme>
            {
                AnimalRhyme.CreatePresentTenseRhyme("bird", "How absurd to"),
                AnimalRhyme.CreatePresentTenseRhyme("cat", "Fancy that to"),
                AnimalRhyme.CreatePresentTenseRhyme("dog", "What a hog, to"),
                AnimalRhyme.CreatePastTenseRhyme("cow", "I don't know how she")
            };
            var songId = Guid.NewGuid();
            var sut    = new domain.Song(songId);

            sut.AddAnimals(animalCollection);
            sut.AddRhymes(rhymeList);
            var result = sut.GetLyrics();

            Approvals.Verify(result);
        }
Example #2
0
 private List <string> ComposeRhyme(AnimalRhyme rhyme, List <string> openingSetences, string separator)
 {
     openingSetences.Add(rhyme == AnimalRhyme.Empty
         ? NO_ANIMAL_RHYME_SENTENCE
         : $"{rhyme.Value}{separator}");
     return(openingSetences);
 }
Example #3
0
        public static Section Create(List <string> animalCollection, AnimalRhyme rhyme, string separator = "!")
        {
            var opening      = new SectionStart(animalCollection.Last());
            var ending       = new SectionEnd(animalCollection.First());
            var animalReview = new AnimalReviewSection(animalCollection);

            return(new Section(opening, rhyme, animalReview.GetSentences(), ending, separator));
        }
Example #4
0
        private List <string> ComposeSentences(SectionStart opening, AnimalRhyme rhyme, List <string> animalReviewSentenceList, SectionEnd ending, string rhymeSeparator)
        {
            var openingSetences   = ComposeOpening(opening);
            var composedSentences = ComposeRhyme(rhyme, openingSetences, rhymeSeparator);

            composedSentences.AddRange(animalReviewSentenceList);
            composedSentences.Add(ending.Value);
            return(composedSentences);
        }
Example #5
0
        static void Main(string[] args)
        {
            var animalCollection = new List <string> {
                "fly",
                "spider",
                "bird",
                "cat",
                "dog",
                "cow",
                "horse"
            };
            var rymeList = new List <AnimalRhyme>
            {
                AnimalRhyme.CreatePresentTenseRhyme("bird", "How absurd to"),
                AnimalRhyme.CreatePresentTenseRhyme("cat", "Fancy that to"),
                AnimalRhyme.CreatePresentTenseRhyme("dog", "What a hog, to"),
                AnimalRhyme.CreatePastTenseRhyme("cow", "I don't know how she")
            };
            var lyrics = new Lyrics(animalCollection, rymeList);

            Console.WriteLine(lyrics.Song);
        }
Example #6
0
 private Section(SectionStart opening, AnimalRhyme rhyme, List <string> animalReviewSentenceList, SectionEnd ending, string rhymeSeparator = "!")
 {
     SentenceList = ComposeSentences(opening, rhyme, animalReviewSentenceList, ending, rhymeSeparator);
 }