예제 #1
0
        public static void Init(IKernel kernel)
        {
            AutoVersionsDBSettings setting = new AutoVersionsDBSettings(@"[CommonApplicationData]\AutoVersionsDB.IntegrationTests");

            kernel.Bind <AutoVersionsDBSettings>().ToConstant(setting);


            MockConsoleError = new Mock <IStandardStreamWriter>();
            MockConsoleOut   = new Mock <IStandardStreamWriter>();

            MockConsole = new Mock <IConsoleExtended>();
            MockConsole.Setup(m => m.Error).Returns(MockConsoleError.Object);
            MockConsole.Setup(m => m.Out).Returns(MockConsoleOut.Object);
            kernel.Bind <IConsoleExtended>().ToConstant(MockConsole.Object);


            ConsoleProcessMessages internalConsoleProcessMessages = kernel.Get <ConsoleProcessMessages>();

            MockConsoleProcessMessages = new Mock <ConsoleProcessMessagesForTests>(MockBehavior.Strict, internalConsoleProcessMessages);
            kernel.Rebind <IConsoleProcessMessages>().ToConstant(MockConsoleProcessMessages.Object);


            NotificationsViewModel internalNotificationsViewModel = kernel.Get <NotificationsViewModel>();

            MockNotificationsViewModel = new Mock <NotificationsViewModelForTests>(MockBehavior.Strict, internalNotificationsViewModel);
            kernel.Rebind <INotificationsViewModel>().ToConstant(MockNotificationsViewModel.Object);

            DBVersionsViewSateManager internalDBVersionsViewSateManager = kernel.Get <DBVersionsViewSateManager>();

            MockDBVersionsViewSateManagerFotTests = new Mock <DBVersionsViewSateManagerForTests>(MockBehavior.Strict, internalDBVersionsViewSateManager);
            kernel.Rebind <IDBVersionsViewSateManager>().ToConstant(MockDBVersionsViewSateManagerFotTests.Object);

            EditProjectViewSateManager internalEditProjectViewSateManager = kernel.Get <EditProjectViewSateManager>();

            MockEditProjectViewSateManagerFotTests = new Mock <EditProjectViewSateManagerForTests>(MockBehavior.Strict, internalEditProjectViewSateManager);
            kernel.Rebind <IEditProjectViewSateManager>().ToConstant(MockEditProjectViewSateManagerFotTests.Object);



            MockOsProcessUtils = new Mock <OsProcessUtils>();
            kernel.Bind <OsProcessUtils>().ToConstant(MockOsProcessUtils.Object);

            MockOsProcessUtils
            .Setup(m => m.StartOsProcess(It.IsAny <string>()))
            .Callback <string>((filename) =>
            {
                //Do nothing
            });

            UIGeneralEvents.OnException += UIGeneralEvents_OnException;
        }
 public DBTypesCommandFactory(ProjectConfigsAPI projectConfigsAPI,
                              ConsoleProcessMessages consoleProcessMessages)
 {
     _projectConfigsAPI      = projectConfigsAPI;
     _consoleProcessMessages = consoleProcessMessages;
 }
예제 #3
0
 public ConsoleProcessMessagesForTests(ConsoleProcessMessages consoleProcessMessages)
 {
     _consoleProcessMessages = consoleProcessMessages;
 }