public void GetValue_ShouldNotThrow(int number) { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); // act void Act() => fizzBuzz.GetValue(number); // assert Check.ThatCode(Act).DoesNotThrow(); }
public void GetValue_ShouldNotThrow(int number) { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); // act Action act = () => fizzBuzz.GetValue(number); // assert act.ShouldNotThrow(); }
public void GetValue_ShouldReturnExpectedResult(int number, string expected) { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); // act var result = fizzBuzz.GetValue(number); // assert Assert.AreEqual(result, expected); }
public void GetValue_ShouldNotThrow(int number) { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); // act void Act() => fizzBuzz.GetValue(number); // assert // No possibility to fluently check if action not throw Act(); }
public void GetValue_WhenGivenNumberIs3_ShouldReturnFizz() { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); const int number = 3; const string expected = "Fizz"; // act var result = fizzBuzz.GetValue(number); // assert Assert.AreEqual(result, expected); }
public void GetValue_WhenGivenNumberIs3_ShouldReturnFizz() { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); const int number = 3; const string expected = "Fizz"; // act var result = fizzBuzz.GetValue(number); // assert result.Should().BeEquivalentTo(expected); }
public void GetValue_ShouldReturnExpectedResult(int number, string expected) { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); // act var result = fizzBuzz.GetValue(number); // assert result.Should().NotBeNull(); result.Should().BeOfType(typeof(string)); result.Should().BeEquivalentTo(expected); }
public void GetValue_WhenGivenNumberIs1_ShouldReturnNumber() { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); const int number = 1; const string expected = "1"; // act var result = fizzBuzz.GetValue(number); // assert result.ShouldEqual(expected); }
public void GetValue_ShouldReturnExpectedResult(int number, string expected) { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); // act var result = fizzBuzz.GetValue(number); // assert Check.That(result).IsNotNull(); Check.That(result).IsInstanceOf <string>(); Check.That(result).Equals(expected); }
public void GetValue_WhenGivenNumberIs5_ShouldReturnBuzz() { // arrange var fizzBuzz = new FizzBuzz.FizzBuzz(); const int number = 5; const string expected = "Buzz"; // act var result = fizzBuzz.GetValue(number); // assert Check.That(result).Equals(expected); }