コード例 #1
0
        public void Execute()
        {
            var quotePrinter = new QuotePrinter();

            Console.Write("{0} ", quotePrinter.AskForQuote());
            var quote = Console.ReadLine();

            Console.Write("{0} ", quotePrinter.AskForAuthor());
            var author = Console.ReadLine();

            Console.WriteLine(quotePrinter.FormatQuote(author, quote));
        }
コード例 #2
0
        public void Execute()
        {
            var quotePrinter = new QuotePrinter();

            Console.Write("{0} ", quotePrinter.AskForQuote());
            var quote = Console.ReadLine();
            
            Console.Write("{0} ", quotePrinter.AskForAuthor());
            var author = Console.ReadLine();

            Console.WriteLine(quotePrinter.FormatQuote(author, quote));
        }
コード例 #3
0
        public void Formatting_Quote()
        {
            string formattedQuote = new QuotePrinter().FormatQuote("Shaun", "This is a quote");

            Assert.That(formattedQuote, Is.EqualTo("Shaun says, \"This is a quote.\""));
        }
コード例 #4
0
        public void Asking_For_An_Author()
        {
            string author = new QuotePrinter().AskForAuthor();

            Assert.That(author, Is.EqualTo("Who said it?"));
        }
コード例 #5
0
        public void Asking_For_A_Quote()
        {
            string quote = new QuotePrinter().AskForQuote();

            Assert.That(quote, Is.EqualTo("What is the quote?"));
        }
コード例 #6
0
 public void Formatting_Quote()
 {
     string formattedQuote = new QuotePrinter().FormatQuote("Shaun", "This is a quote");
     Assert.That(formattedQuote, Is.EqualTo("Shaun says, \"This is a quote.\""));
 }
コード例 #7
0
 public void Asking_For_An_Author()
 {
     string author = new QuotePrinter().AskForAuthor();
     Assert.That(author, Is.EqualTo("Who said it?"));
 }
コード例 #8
0
 public void Asking_For_A_Quote()
 {
     string quote = new QuotePrinter().AskForQuote();
     Assert.That(quote, Is.EqualTo("What is the quote?"));
 }