public void TestNewFinishCommand() { FinishCommand command = MvcFactory.NewFinishCommand(); Assert.IsNotNull(command); Assert.IsInstanceOf(typeof(FinishCommandImpl), command); }
public void CreateDefinition() { ApplicationDefinition application = University.Create(); ApplicationInfo applicationInfo = new ApplicationInfo(); applicationInfo.Set(application); CrudCreator crudCreator = new CrudCreator(); crudCreator.Create(applicationInfo); Shipment shipment = new Shipment(); EfFactory factory = new EfFactory(); factory.Manufacture(shipment, applicationInfo); EnumerationFactory enumerationFactory = new EnumerationFactory(); enumerationFactory.Manufacture(shipment, applicationInfo); MvcFactory mvcFactory = new MvcFactory(); mvcFactory.Manufacture(shipment, applicationInfo); shipment.Save(@"C:\Sources\Plastic\Plastic.University"); }
public void TestNewStartCommand() { StartCommand command = MvcFactory.NewStartCommand(); Assert.IsNotNull(command); Assert.IsInstanceOf(typeof(StartCommandImpl), command); }
[Test] public void TestNewUnknownCommand() { UnknownCommand command = MvcFactory.NewUnknownCommand("a comment string"); Assert.That(command, Is.Not.Null); Assert.That(command, Is.InstanceOf(typeof(UnknownCommandImpl))); Assert.That(command.Comment, Is.EqualTo("a comment string")); }
public void TestRun() { Controller mockController = MockMvcFactory.NewMockController(MvcFactory); MockControllerImpl mockControllerImpl = (MockControllerImpl)mockController; FinishCommand command = MvcFactory.NewFinishCommand(); command.Process(mockController); Assert.IsTrue(mockControllerImpl.FinishCommandsProcessed.Contains(command)); }
public void ActionsArePrepared() { var types = typeof(EchoAction).Assembly.GetTypes().Where(x => typeof(IAction).IsAssignableFrom(x) && !x.IsAbstract); foreach (var type in types) { Assert.NotNull(container.Get <IAction>(MvcFactory.NormalizeActionName(ActionAttribute.GetName(type))), type.FullName); } }
public void TestNewSafeView() { View unsafeView = new MockViewImpl(); View safeView = MvcFactory.NewSafeView(unsafeView); Assert.That(safeView, Is.Not.Null); Assert.That(safeView, Is.InstanceOf(typeof(SafeViewImpl))); SafeViewImpl safeViewImpl = safeView as SafeViewImpl; Assert.That(safeViewImpl.UnsafeView, Is.EqualTo(unsafeView)); }
public void TestProcess() { Controller mockController = MockMvcFactory.NewMockController(this.MvcFactory); MockControllerImpl mockControllerImpl = (MockControllerImpl)mockController; StartCommand startCommand = MvcFactory.NewStartCommand(); FinishCommand finishCommand = MvcFactory.NewFinishCommand(); mockController.Process(startCommand); mockController.Process(finishCommand); Assert.IsTrue(mockControllerImpl.StartCommandsProcessed.Contains(startCommand)); Assert.IsTrue(mockControllerImpl.FinishCommandsProcessed.Contains(finishCommand)); }
public void TestNewModelAndView() { IDictionary <string, object> model = new Dictionary <string, object>(); model.Add("modelComponent1", "modelValue1"); string viewName = "testViewName"; ModelAndView modelAndView = MvcFactory.NewModelAndView(model, viewName); Assert.IsNotNull(modelAndView); Assert.IsInstanceOf(typeof(ModelAndViewImpl), modelAndView); Assert.AreEqual(model, modelAndView.Model); Assert.AreEqual(viewName, modelAndView.ViewName); }
public void TestNewDriver() { ViewResolver viewResolver = MockMvcFactory.NewMockViewResolver(); Input input = MockMvcFactory.NewMockInput(); Output output = MockMvcFactory.NewMockOutput(viewResolver); Controller controller = MockMvcFactory.NewMockController(MvcFactory); Driver driver = MvcFactory.NewDriver(input, output, controller); Assert.IsNotNull(driver); Assert.IsInstanceOf(typeof(DriverImpl), driver); DriverImpl driverImpl = (DriverImpl)driver; Assert.AreEqual(MvcFactory, driverImpl.Factory); Assert.AreEqual(input, driverImpl.Input); Assert.AreEqual(output, driverImpl.Output); Assert.AreEqual(controller, driverImpl.Controller); Assert.IsTrue(LoggerSetterImpl.LoggerRecipients.Contains(driver)); }
public void TestToString() { FinishCommand command = MvcFactory.NewFinishCommand(); Assert.AreEqual("FinishCommand", command.ToString()); }
public void TestToString() { StartCommand command = MvcFactory.NewStartCommand(); Assert.AreEqual("StartCommand", command.ToString()); }