public void Initialize() { this.dbContext = new FakeDatabaseContext(); this.workbook = new Workbook(this.dbContext, WinSettings.Instance); this.views = new List <ISystemView> { new SystemView { ViewKind = ViewKind.Today }, new SystemView { ViewKind = ViewKind.Tomorrow }, new SystemView { ViewKind = ViewKind.Starred }, new SystemView { ViewKind = ViewKind.Late } }; foreach (var view in this.views) { this.dbContext.AddSystemView(view); } this.workbook.Initialize(); UITestHelper.ExecuteOnUIThread(() => { this.viewmodel = this.CreateMainPageViewModel(); var manager = new NavigationMenuManager(this.workbook, new TestSynchronizationManager(), this.viewmodel); }); }
public void OnSetup() { _uiTestHelper = new UITestHelper(); _uiTestHelper.ExecuteOnUIThread(() => { _navigationManagerImpl = new NavigationManagerImpl(new FakeViewLocator()); _navigationManagerImpl.SetMainWorkspace(new Grid(), new FakeWorkspaceAdapter()); }); }
public void It_must_track_smart_views() { UITestHelper.ExecuteOnUIThread(() => { this.workbook.AddSmartView("SV1", SmartViewRule); this.AssertMenu("SV1"); this.workbook.RemoveSmartView("SV1"); this.AssertMenu(); }); }
public void OnSetup() { _uiTestHelper = new UITestHelper(); _uiTestHelper.ExecuteOnUIThread(() => { _workspace = new Grid(); _workspaceAdapter = new GridWorkspaceAdapter(); //_workspaceAdapter.SetTransitionAnimationProvider(TransitionAnimation.Create); _workspaceAdapter.SetMainWorkspace(_workspace); _workspaceAdapter.SetViewGroupCollection(new ViewGroupCollection()); }); }
public void It_must_track_folders() { UITestHelper.ExecuteOnUIThread(() => { this.workbook.AddFolder("1"); this.AssertMenu("1"); this.workbook.RemoveFolder("1"); this.AssertMenu(); this.workbook.AddFolder("2"); this.workbook.AddFolder("3"); this.AssertMenu("2", "3"); }); }
public void It_must_track_views() { UITestHelper.ExecuteOnUIThread(() => { this.views[0].IsEnabled = true; this.AssertMenu("today"); this.views[0].IsEnabled = false; this.AssertMenu(); this.views[0].IsEnabled = true; this.views[1].IsEnabled = true; this.AssertMenu("today", "tomorrow"); }); }
public void It_must_track_contexts() { UITestHelper.ExecuteOnUIThread(() => { this.workbook.AddContext("1"); this.AssertMenu("1"); this.workbook.RemoveContext("1"); this.AssertMenu(); this.workbook.AddContext("2"); this.workbook.AddContext("3"); this.AssertMenu("2", "3"); }); }
public void When_timer_ticks_start_date_is_checked() { UITestHelper.ExecuteOnUIThread(() => { // setup this.Setup(DateTime.Now.AddDays(1)); Assert.AreEqual(0, this.folderItemViewModel.SmartCollection.Count); // act StaticTestOverrides.Now = DateTime.Now.AddDays(1); this.scheduler.OnUpdateTasksTimerTick(); // verify Assert.AreEqual(1, this.folderItemViewModel.SmartCollection.Count); }); }
public void When_timer_ticks_collection_is_rebuilt() { UITestHelper.ExecuteOnUIThread(() => { // setup this.Setup(null); Assert.IsTrue(this.folderItemViewModel.SmartCollection.Items[0].Title.StartsWith("Today")); // act StaticTestOverrides.Now = DateTime.Now.AddDays(1); this.scheduler.OnUpdateTasksTimerTick(); // verify Assert.IsFalse(this.folderItemViewModel.SmartCollection.Items[0].Title.StartsWith("Today")); }); }
public void It_must_manage_separators_add_context() { UITestHelper.ExecuteOnUIThread(() => { this.AssertMenu(); this.views[0].IsEnabled = true; this.workbook.AddTag("t2"); this.workbook.AddFolder("f1"); this.AssertMenu("today", "", "f1", "", "t2"); this.workbook.AddContext("c3"); this.AssertMenu("today", "", "f1", "", "c3", "", "t2"); }); }
public void Starts_with_2_smart_views() { UITestHelper.ExecuteOnUIThread(() => { this.viewmodel = this.CreateMainPageViewModel(); var manager = new NavigationMenuManager(this.workbook, new TestSynchronizationManager(), this.viewmodel); this.AssertMenu(); this.views[0].IsEnabled = true; this.workbook.AddSmartView("sv1", SmartViewRule); this.workbook.AddSmartView("sv2", SmartViewRule); this.AssertMenu("today", "", "sv1", "sv2"); }); }
public void It_must_manage_separators() { UITestHelper.ExecuteOnUIThread(() => { this.AssertMenu(); this.views[0].IsEnabled = true; this.AssertMenu("today"); this.workbook.AddFolder("f1"); this.AssertMenu("today", "", "f1"); this.views[1].IsEnabled = true; this.AssertMenu("today", "tomorrow", "", "f1"); this.workbook.AddContext("c2"); this.AssertMenu("today", "tomorrow", "", "f1", "", "c2"); this.workbook.AddTag("t3"); this.AssertMenu("today", "tomorrow", "", "f1", "", "c2", "", "t3"); this.workbook.AddSmartView("sv1", SmartViewRule); this.AssertMenu("today", "tomorrow", "", "sv1", "", "f1", "", "c2", "", "t3"); this.views[1].IsEnabled = false; this.AssertMenu("today", "", "sv1", "", "f1", "", "c2", "", "t3"); this.views[0].IsEnabled = false; this.AssertMenu("sv1", "", "f1", "", "c2", "", "t3"); this.workbook.RemoveFolder("f1"); this.AssertMenu("sv1", "", "c2", "", "t3"); this.workbook.RemoveTag("t3"); this.AssertMenu("sv1", "", "c2"); this.workbook.RemoveContext("c2"); this.AssertMenu("sv1"); this.workbook.RemoveSmartView("sv1"); this.AssertMenu(); }); }