public void FizzBuzzConverter_ReturnsFizz_MultipleOfThreeNotContainingAThree()
        {
            var multipleOfThree = 9;
            var result          = fizzBuzzConverter.Convert(multipleOfThree);

            Assert.Equal(fizz, result);
        }
        public void FizzBuzzConverter_ReturnsLucky_ContainsAThree(int testCase)
        {
            var fizzBuzzConverter = new FizzBuzzConverter();

            var result = fizzBuzzConverter.Convert(testCase);

            Assert.Equal(lucky, result);
        }
        public void WhenNumberIsNotSpecial_ThenDoNotConvert()
        {
            var converter = new FizzBuzzConverter();
            var number    = 1;

            var convertedNumber = converter.Convert(number);

            Assert.Equal("1", convertedNumber);
        }
        public void WhenDivisibleByThreeAndFive_ThenConvertToFizzBuzz()
        {
            var converter = new FizzBuzzConverter();
            var number    = 15;

            var convertedNumber = converter.Convert(number);

            Assert.Equal("FizzBuzz", convertedNumber);
        }
        public void FizzBuzzConverter_ReturnsFizzBuzz_MultipleOfThreeAndFive()
        {
            var multipleOfThreeAndFive = 15;
            var fizzBuzzConverter      = new FizzBuzzConverter();

            var result = fizzBuzzConverter.Convert(multipleOfThreeAndFive);

            Assert.Equal(fizz + buzz, result);
        }
        public void FizzBuzzConverter_ReturnsBuzz_MultipleOfFiveNotContainingAThree()
        {
            var multipleOfFive    = 5;
            var fizzBuzzConverter = new FizzBuzzConverter();

            var result = fizzBuzzConverter.Convert(multipleOfFive);

            Assert.Equal(buzz, result);
        }
        public void Convert_DoublesRule(List <PriorityFizzBuzzRule> rules, uint input, string expect)
        {
            var target = new FizzBuzzConverter();

            foreach (var rule in rules)
            {
                target.Handle(rule);
            }

            target.Convert(input).Is(expect);
        }
Exemple #8
0
        public void Convert_1_returns_1()
        {
            // Arrange
            var target = new FizzBuzzConverter();

            // Act
            var actual = target.Convert(new List <int> {
                1
            });

            // Assert
            var expected = new List <string> {
                "1"
            };

            Assert.IsTrue(expected.SequenceEqual(actual));
        }
Exemple #9
0
        public void Given_1_than_1_is_returned()
        {
            var result = sut.Convert(1);

            Assert.AreEqual("1", result);
        }
        private void Should_Convert_Number_To_ExpectedOutput(int numberToConvert, string expected)
        {
            string result = _sut.Convert(numberToConvert);

            result.Should().Be(expected);
        }