示例#1
0
        public void TellStory_CreatesAStoryWithACharacter()
        {
            var result = bard.TellStory(keywords);

            Assert.NotNull(result.MainCharacter);
            Assert.Equal("Zebra", result.MainCharacter.Type);
            Assert.Equal("fat", result.MainCharacter.Adjective);
            Assert.Equal("pizza", result.MainCharacter.FavouriteFood);
        }
示例#2
0
        static void Main(string[] args)
        {
            bard = new Bard(GetMainProjectDirectory());

            TellThemWhatWereAllAbout();
            string theme = Console.ReadLine();

            var words = new WordProcessor(GetMainProjectDirectory()).GetWordsFromSentence(theme);

            try
            {
                var story = bard.TellStory(words);
                Console.WriteLine("Well, here we go... are you ready? here is my story!");
                Console.WriteLine(story.Title);
                Console.WriteLine("==========================================================");

                foreach (var line in story.Content)
                {
                    Thread.Sleep(2000);
                    Console.WriteLine(line);
                }
            }
            catch (InvalidInputException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }