public void GetValue_ShouldNotThrow(int number)
        {
            // arrange

            var fizzBuzz = new FizzBuzz.FizzBuzz();

            // act

            void Act() => fizzBuzz.GetValue(number);

            // assert
            Check.ThatCode(Act).DoesNotThrow();
        }
Exemplo n.º 2
0
        public void GetValue_ShouldNotThrow(int number)
        {
            // arrange

            var fizzBuzz = new FizzBuzz.FizzBuzz();

            // act

            Action act = () => fizzBuzz.GetValue(number);

            // assert

            act.ShouldNotThrow();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 10
0
        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);
        }