コード例 #1
0
        public Driver NewDriver(
            Input input,
            Output output,
            Controller controller
            )
        {
            DriverImpl driver = new DriverImpl();

            driver.Factory    = this;
            driver.Input      = input;
            driver.Output     = output;
            driver.Controller = controller;
            LoggerSetter.Add(driver);
            return(driver);
        }
コード例 #2
0
        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));
        }