public void ShouldReturn400()
        {
            var loggerMock   = new Mock <ILogger <FizzBuzz> >();
            var serviceMock  = new FizzBuzz(loggerMock.Object);
            var actionResult = new FizzBuzzController(serviceMock);

            var result = actionResult.FizzBuzz(101).Result as ObjectResult;

            Assert.Equal(StatusCodes.Status400BadRequest, result.StatusCode);
        }
Ejemplo n.º 2
0
        public void GetFizzBuzz_Return_OkResultAndFizzBuzzValueForFifteen()
        {
            var model = new FizzBuzzStore {
                FizzBuzzStoreID = 15, FizzBuzzValue = "FizzBuzz"
            };
            var controller = new FizzBuzzController(context);

            var data = controller.FizzBuzz();

            Assert.IsType <OkObjectResult>(data.Find(x => x.FizzBuzzStoreID == 15));
        }