public void GetFizzBuzzData_ShouldReturnBuzz_WhenInputNumberIs5(int inputValue, string expectedResult) { this.ruleMock = new Mock <IRule>(); this.ruleMock.Setup(x => x.IsDivisible(inputValue)).Returns(true); this.ruleMock.Setup(y => y.GetValue()).Returns(Constants.Buzz); var businesrule = new[] { this.ruleMock.Object }; var results = new FizzBuzzService(businesrule); var actual = results.GetFizzBuzzData(inputValue); Assert.AreEqual(actual[4], expectedResult); }
public void GetFizzBuzzDataTest(int inputValue, string[] expectedResult) { this.ruleMock = new Mock <IRule>(); this.ruleMock.Setup(x => x.IsDivisible(inputValue)).Returns(false); this.ruleMock.Setup(y => y.GetValue()).Returns(string.Empty); var businesrule = new[] { this.ruleMock.Object, this.ruleMock.Object }; var results = new FizzBuzzService(businesrule); var actual = results.GetFizzBuzzData(inputValue); Assert.AreEqual(actual, expectedResult); }