Exemplo n.º 1
0
        public void CreatePartial()
        {
            // Arrange
            var service    = Substitute.For <IPizzaService>();
            var controller = new PizzaController(service);

            service.GetAllComponents().Returns(components);

            // Act
            var result            = controller.CreatePartial() as PartialViewResult;
            var viewName          = result.ViewName;
            var viewBagComponents = result.ViewBag.Components;

            // Assert
            Assert.That(result, !Is.Null);
            Assert.That(viewBagComponents, !Is.Null);
            Assert.That("_CreatePartial", Is.EqualTo(viewName));
        }