public WhenTodoItemIsConvertedToEditFields() { var todoList = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.High) .Build(); srcTodoItem = todoList.Items.First(); resultFields = TodoItemEditFieldsFactory.Create(srcTodoItem); }
public AndHideCompletedItemsFalse() { var user = new IdentityUser("*****@*****.**"); user.Email = user.UserName; var todoList = new TestTodoListBuilder(user, "shopping list") .WithItem("Completed Item", Importance.Medium, completed: true) .WithItem("Uncompleted Item", Importance.Medium) .Build(); resultViewModel = TodoListDetailViewmodelFactory.Create(todoList, false, TodoListSortFields.Default); }
public AndOrderByFieldRank() { var user = new IdentityUser("*****@*****.**"); user.Email = user.UserName; var todoList = new TestTodoListBuilder(user, "shopping list") .WithItem("1", Importance.Low, rank: 3) .WithItem("2", Importance.High, rank: 2) .WithItem("3", Importance.Medium, rank: 1) .Build(); resultViewModel = TodoListDetailViewmodelFactory.Create(todoList, true, TodoListSortFields.Rank); }
public WhenTodoItemIsConvertedToSummaryView() { var todoList = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.High) .Build() ; srcTodoItem = todoList.Items.First(); //change IsDone to true because default is false. srcTodoItem.IsDone = true; srcTodoItem.ResponsibleParty = todoList.Owner; resultFields = TodoItemSummaryViewmodelFactory.Create(srcTodoItem); }
public WhenGettingRelevantTodoLists() { todoList1 = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.High) .WithItem("milk", Importance.High) .WithItem("cheese", Importance.Medium) .WithItem("lettuce", Importance.Low) .WithItem("tomato", Importance.Medium) .Build(); todoList2 = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "workshop") .WithItem("timber", Importance.High) .WithItem("saw", Importance.High) .WithItem("drill", Importance.Medium) .WithItem("bench", Importance.Low) .WithItem("vacuum", Importance.Medium) .Build(); }
public WhenGettingSingleTodoItem() { var todoList = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.High) .Build(); srcTodoItem = todoList.Items.First(); WithContext(context => { context.Add(srcTodoItem); context.SaveChanges(); }); WithContext(context => { resultTodoItem = context.SingleTodoItem(srcTodoItem.TodoItemId); }); }
public WhenGettingSingleTodoList() { srcTodoList = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.High) .WithItem("milk", Importance.High) .WithItem("cheese", Importance.Medium) .WithItem("lettuce", Importance.Low) .WithItem("tomato", Importance.Medium) .Build(); WithContext(context => { context.Add(srcTodoList); context.SaveChanges(); }); WithContext(context => { resultTodoList = context.SingleTodoList(srcTodoList.TodoListId); }); }