Пример #1
0
		public void IsRunning_set_to_correct_values()
		{
			var task = new TestTask1();

			Assert.IsFalse(task.IsRunning);
			task.Start(_viewDeck);
			Assert.IsTrue(task.IsRunning);
		}
Пример #2
0
		public void Current_is_null_when_not_running()
		{
			var task = new TestTask1();
			Assert.IsNull(UITask.Current);
			task.Start(_viewDeck);
			// not navigating, so should be null again
			Assert.IsNull(UITask.Current);

			// Presenter1 has a check that UITask.Current is non-null when it is initializing.
		}
Пример #3
0
		public void NavigateCommands_are_created()
		{
			var task = new TestTask1();
			task.Start(_viewDeck);

			var presenter = task.CurrentNode.Presenter as Presenter1;
			Assert.IsNotNull(presenter);
			Assert.IsNotNull(presenter.Next);
			Assert.IsNotNull(presenter.Error);
			Assert.AreNotSame(presenter.Next, presenter.Error);
		}
Пример #4
0
		public void Can_navigate_to_next_node()
		{
			var task = new TestTask1();
			task.Start(_viewDeck);

			var view1 = task.CurrentNode.View as View1;
			Assert.IsNotNull(view1);
			view1.ClickButton1();

			var view2 = task.CurrentNode.View as View2;
			Assert.IsNotNull(view2);
			view2.ClickBackButton();

			var view3 = task.CurrentNode.View as View1;
			Assert.IsNotNull(view3);
		}
Пример #5
0
		public void Container_injects_different_navigate_command_objects()
		{
			var task = new TestTask1();
			task.Start(_viewDeck);

			var presenter1 = task.CurrentNode.Presenter as Presenter1;
			Assert.IsNotNull(presenter1);
			Assert.IsNotNull(presenter1.Next);
			Assert.IsNotNull(presenter1.Error);
			Assert.AreNotSame(presenter1.Next, presenter1.Error);
		}
Пример #6
0
		public void Container_injects_task_objects()
		{
			var task = new TestTask1();
			task.Start(_viewDeck);

			var presenter1 = task.CurrentNode.Presenter as Presenter1;
			Assert.IsNotNull(presenter1);
			Assert.AreSame(task, presenter1.UITask);
			Assert.AreSame(task, presenter1.TestTask1);
			Assert.AreSame(_viewDeck, presenter1.ViewDeck);
			Assert.AreSame(task.Nodes[0], presenter1.UINode);
		}
Пример #7
0
		public void Task_finishes_when_EndTask_called()
		{
			var taskCompleteEventRaised = false;
			var task = new TestTask1();
			task.TaskComplete += delegate { taskCompleteEventRaised = true; };
			task.Start(_viewDeck);

			var view1 = task.CurrentNode.View as View1;
			Assert.IsNotNull(view1);
			view1.ClickButton1();

			task.EndTask();

			Assert.IsFalse(task.IsRunning);
			Assert.IsTrue(task.IsComplete);
			Assert.IsTrue(taskCompleteEventRaised);
		}