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); }
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); }
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); }
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(); }