Ejemplo n.º 1
0
        public async Task CreatePostSpotlightConnectorController()
        {
            var context    = GetInMemoryDbMetData();
            var controller = new SpotLightConnectorsController(context);

            var result = await controller.Create(spotLightConnectors[0], null);

            var viewResult = Assert.IsType <RedirectToActionResult>(result);

            Assert.Equal("Index", viewResult.ActionName);
        }
Ejemplo n.º 2
0
        public void CreateSpotlightConnectorController()
        {
            var context    = GetInMemoryDbMetData();
            var controller = new SpotLightConnectorsController(context);

            var result = controller.Create();

            var viewResult = Assert.IsType <ViewResult>(result);
            var model      = Assert.IsAssignableFrom <SpotlightViewModel>(viewResult.ViewData.Model);

            Assert.Equal(1, model.SpotLightItems[1].Id);
            Assert.Equal("ProductIndex", model.SpotLightItems[0].Title);
        }