Example #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 prismSettingsManager = new PrismSettingsManager(fakeApplicationController);
            var settings             = prismSettingsManager.Resolve <TClass>();

            Assert.IsNotNull(settings);

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

            settingsFiles = FileUtility.GetFiles(fakeApplicationController.SettingsPath);
            Assert.AreEqual(1, settingsFiles.Count());
            prismSettingsManager = new PrismSettingsManager(fakeApplicationController);
            settings             = prismSettingsManager.Resolve <TClass>();
            Assert.IsNotNull(settings);
        }
Example #2
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);
        }
Example #3
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();
        }