Beispiel #1
0
        public void SetCount_Number_Of_Values()
        {
            //Arrange
            var mock = new Mock <IFizzBuzzRepository>();

            mock.Setup(x => x.AddFizzBuzz(It.IsAny <List <FizzBuzz> >()));
            var service = new FizzBuzzService(mock.Object);

            //Act
            var result = service.SetCount(100).ToList();

            //Assert
            Assert.AreEqual(100, result.Count);
        }
Beispiel #2
0
        public void SetCount_WhenRangeInModulo3_Wednesday()
        {
            //Arrange
            var mock = new Mock <IFizzBuzzRepository>();

            mock.Setup(x => x.AddFizzBuzz(It.IsAny <List <FizzBuzz> >()));
            var service = new FizzBuzzService(mock.Object);

            //Act
            var result = service.SetCount(100).ToList();

            //Assert
            Assert.AreEqual("fizz", result[8].Text);
            Assert.AreEqual("fizz", result[26].Text);
            Assert.AreEqual(94, result.Count(x => x.Text != "fizz buzz"));
        }