Esempio n. 1
0
        public void Should_Be_Ok_When_GetById(int id)
        {
            var fakes            = new FakeContext("LayerControllerTest");
            var fakeLayerService = fakes.FakeLayerService().Object;
            var expected         = fakeLayerService.Get(id);
            var controller       = new LayerController(fakeLayerService);

            var result       = controller.Get(id);
            var actionResult = result as OkObjectResult;

            Assert.IsType <OkObjectResult>(actionResult);
            var actual = actionResult.Value as LayerViewModel;

            Assert.NotNull(actual);
            Assert.Equal(expected, actual, new LayerViewModelIDComparer());
        }