コード例 #1
0
        public void Get_by_id_returns_expected_results(int id, Type responseType)
        {
            var controller = new ExampleController(Helpers.MockExampleBusinessLogic(), Helpers.MockIAppSettings());

            var response = controller.GetById(id);

            response.Should().BeOfType(responseType);

            if (response is OkObjectResult)
            {
                var result = ((OkObjectResult)response).Value as ExampleModel;

                Assert.IsTrue(result.Equals(Helpers.TestModel));
            }
        }