コード例 #1
0
        public void Fibinacci_ReturnsOk()
        {
            var expected = new List <double>
            {
                1, 1, 2, 3, 5, 8, 13, 21, 34, 55
            };

            validationService.IsValidApiToken(Arg.Any <string>()).Returns(true);
            mathService.GetFibonacci(Arg.Any <int>()).Returns(expected);

            var response = controller.Fibinacci(10);

            Assert.IsType <OkObjectResult>(response);
            var value = ((OkObjectResult)response).Value;

            Assert.IsType <List <double> >(value);
            ((List <double>)value).Should().BeEquivalentTo(expected);
        }