コード例 #1
0
 public void then_an_error_message_should_be_displayed_instead_of_a_sequence() =>
 SequenceGenerator.GenerateFizzBuzz(30, 1).Should().Be("Invalid sequence: The start (30) is higher than the end (1).  Please make the start number of the sequence higher than the end number (e.g. (1, 30) )");
コード例 #2
0
 public void Then_the_sequence_should_be_followed_by_a_report_summarising_the_words_returned() =>
 SequenceGenerator.GenerateFizzBuzz(1, 30).Split(Environment.NewLine).Last().Should().Be("fizz: 7 buzz: 4 fizzbuzz: 1 lucky: 4 integer: 14");
コード例 #3
0
 public void then_the_sequence_should_start_with_fizzbuzz() =>
 SequenceGenerator.GenerateFizzBuzz(0, 30).Should().StartWith("fizzbuzz 1", because: "zero is divisible by everything, but does not contain a 3");
コード例 #4
0
 public void Then_the_sequence_should_be_followed_by_a_report_summarising_the_words_returned(int start, int end, string result) =>
 SequenceGenerator.GenerateFizzBuzz(start, end).Split(Environment.NewLine).Last().Should().Be(result);
コード例 #5
0
 public void then_any_multiple_of_both_5_and_3_should_be_replaced_with_the_word_fizzbuzz() =>
 SequenceGenerator.GenerateFizzBuzz(1, 30).Split(Environment.NewLine).First().Should().Be("1 2 lucky 4 buzz fizz 7 8 fizz buzz 11 fizz lucky 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 lucky fizz buzz 26 fizz 28 29 lucky");
コード例 #6
0
 public void Then_the_5_is_replaced_with_the_word_buzz(int start, int end, string result) =>
 SequenceGenerator.GenerateFizzBuzz(start, end).Split(Environment.NewLine).First().Should().Be(result);
コード例 #7
0
 public void Then_numbers_with_a_3_digit_should_be_replaced_with_the_word_lucky(int start, int end, string result) =>
 SequenceGenerator.GenerateFizzBuzz(start, end).Split(Environment.NewLine).First().Should().Be(result);
コード例 #8
0
 public void then_there_should_not_be_a_report_appended() =>
 SequenceGenerator.GenerateFizzBuzz(30, 1).Split(Environment.NewLine).Count().Should().Be(1);
コード例 #9
0
 public void then_any_multiple_of_both_5_and_3_should_be_replaced_with_the_word_fizzbuzz() =>
 SequenceGenerator.GenerateFizzBuzz(1, 30).Should().Be("1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz");
コード例 #10
0
 public void Then_the_5_is_replaced_with_the_word_buzz(int start, int end, string result) =>
 SequenceGenerator.GenerateFizzBuzz(start, end).Should().Be(result);