示例#1
0
        public void ExecuteTest()
        {
            var fakeApplicationController = new FakeApplicationController();

            FileUtility.DeleteFiles(fakeApplicationController.SettingsPath);

            var testApplication = TestApplication.CreateTestApplication();

            testApplication.Controller.RegisterType <IDialogController, AutoDialogController>();
            testApplication.AddModule <TSettingsModule>();
            var module = testApplication.GetModule <TSettingsModule>();

            module.DialogCommand();
            var dialog = testApplication.GetNavigatedDialog <TDialog>();

            var settingsFiles = FileUtility.GetFiles(fakeApplicationController.SettingsPath);

            Assert.AreEqual(1, settingsFiles.Count());
            var settingsManager = new DesktopSettingsManager(fakeApplicationController);
            var settings        = settingsManager.Resolve <TClass>();

            Assert.IsNotNull(settings);

            module.DialogCommand();
            dialog = testApplication.GetNavigatedDialog <TDialog>();

            settingsFiles = FileUtility.GetFiles(fakeApplicationController.SettingsPath);
            Assert.AreEqual(1, settingsFiles.Count());
            settingsManager = new DesktopSettingsManager(fakeApplicationController);
            settings        = settingsManager.Resolve <TClass>();
            Assert.IsNotNull(settings);
        }
示例#2
0
        protected virtual TestApplication CreateAndLoadTestApplication <TModule>(ApplicationControllerBase applicationController = null, ISettingsManager settingsManager = null, bool loadXrmConnection = true)
            where TModule : ModuleBase, new()
        {
            var testApplication = TestApplication.CreateTestApplication(applicationController, settingsManager);

            testApplication.AddModule <TModule>();
            return(testApplication);
        }
示例#3
0
        public void ExecuteObjectEntryTest(object instanceToEnter)
        {
            var testApplication = TestApplication.CreateTestApplication();

            testApplication.Controller.RegisterType <IDialogController, FakeDialogController>();
            testApplication.AddModule <TModule>();
            var module = testApplication.GetModule <TModule>();

            module.DialogCommand();
            //autodialog should process the dialog when get it
            var dialog    = testApplication.GetNavigatedDialog <TDialog>();
            var entryForm = testApplication.GetSubObjectEntryViewModel(dialog);

            testApplication.EnterAndSaveObject(instanceToEnter, entryForm);
        }
示例#4
0
        public void ExecuteAutoEntryTest()
        {
            PrepareTest();

            var testApplication = TestApplication.CreateTestApplication();

            testApplication.Controller.RegisterType <IDialogController, AutoDialogController>();
            testApplication.AddModule <TModule>();
            var module = testApplication.GetModule <TModule>();

            module.DialogCommand();
            //autodialog should process the dialog when get it
            testApplication.GetNavigatedDialog <TDialog>();

            CompleteTest();
        }