Ejemplo n.º 1
0
 void Ex02()
 {
     When("the content of the to-do is set", () => MainContent.TodoContent.Value = TodoContent1);
     When("to add the current content of the to-do", () => MainContent.AddCurrentTodoContent());
     Then("the items should have one item that has the given content of the to-do and is Active state", () =>
          MainContent.TodoItems.Count == 1 &&
          MainContent.TodoItems[0].Content.Value == TodoContent1 &&
          MainContent.TodoItems[0].State.Value == TodoItemState.Active
          );
     Then("the content of the to-do should be empty", () => MainContent.TodoContent.Value = string.Empty);
     Then("the AllCompleted should be visible", () => MainContent.CanCompleteAllTodoItems.Value);
     Then("the ItemsLeftMessage should be a string that expresses 1 item left", () => MainContent.ItemsLeftMessage.Value = "1 item left");
 }
Ejemplo n.º 2
0
 void Ex03()
 {
     When("the content of the to-do is set", () => MainContent.TodoContent.Value = TodoContent1);
     When("to add the current content of the to-do", () => MainContent.AddCurrentTodoContent());
     When("the content of the to-do is set again", () => MainContent.TodoContent.Value = TodoContent2);
     When("to add the current content of the to-do", () => MainContent.AddCurrentTodoContent());
     Then("the items should be two items that have the given content of the to-do and are Active state", () =>
          MainContent.TodoItems.Count == 2 &&
          MainContent.TodoItems[0].Content.Value == TodoContent1 &&
          MainContent.TodoItems[0].State.Value == TodoItemState.Active &&
          MainContent.TodoItems[1].Content.Value == TodoContent2 &&
          MainContent.TodoItems[1].State.Value == TodoItemState.Active
          );
     Then("the content of the to-do should be empty", () => MainContent.TodoContent.Value = string.Empty);
     Then("the AllCompleted should be visible", () => MainContent.CanCompleteAllTodoItems.Value);
     Then("the ItemsLeftMessage should be a string that expresses 2 items left", () => MainContent.ItemsLeftMessage.Value = "2 items left");
 }
Ejemplo n.º 3
0
 void AddTodoContent(string content)
 {
     MainContent.TodoContent.Value = content;
     MainContent.AddCurrentTodoContent();
 }