private void SetupUserAndLists() { //first user only has lists and items they own and are responsible for //second user has has one item that user 3 is responsible for //third user has one item in the second user's list that they are responsible for firstUser = new IdentityUser("*****@*****.**"); secondUser = new IdentityUser("*****@*****.**"); thirdUser = new IdentityUser("*****@*****.**"); Assert.NotEqual(firstUser.Id, secondUser.Id); Assert.NotEqual(firstUser.Id, thirdUser.Id); Assert.NotEqual(secondUser.Id, thirdUser.Id); var todoListFirstUserShopping = new TestTodoListBuilder(firstUser, "shopping") .WithItem("bread", Importance.High, firstUser.Id) .WithItem("cheese", Importance.High, firstUser.Id) .Build(); dbContext.Add(todoListFirstUserShopping); dbContext.SaveChanges(); var todoListFirstUserDIY = new TestTodoListBuilder(firstUser, "DIY") .WithItem("paint door", Importance.High, firstUser.Id) .WithItem("tidy garden", Importance.High, firstUser.Id) .Build(); dbContext.Add(todoListFirstUserDIY); dbContext.SaveChanges(); var todoListSecondUser = new TestTodoListBuilder(secondUser, "task list U2L1") .WithItem("Second user list 1 Task 1", Importance.High, secondUser.Id) .WithItem("Second user list 1 Task 2", Importance.High, secondUser.Id) .Build(); dbContext.Add(todoListSecondUser); dbContext.SaveChanges(); var todoListThirdUser = new TestTodoListBuilder(thirdUser, "task list U3L1") .WithItem("Third user list 1 Task 1", Importance.High, thirdUser.Id) .WithItem("Third user list 1 Task 2", Importance.High, thirdUser.Id) .WithItem("Third user list 1 Task 3", Importance.High, thirdUser.Id) .Build(); dbContext.Add(todoListThirdUser); dbContext.SaveChanges(); var todoListSecondUserSecondList = new TestTodoListBuilder(secondUser, "task list U2L2") .WithItem("Second user list 2 Task 1", Importance.High, secondUser.Id) .WithItem("Second user list 2 Task 2", Importance.High, secondUser.Id) .WithItem("Second user list 2 Task 3", Importance.High, thirdUser.Id) //different resposible party .Build(); dbContext.Add(todoListSecondUserSecondList); dbContext.SaveChanges(); }
public TodoListDetailViewmodelFactoryTests() { var todoList = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.Medium) .WithItem("milk", Importance.Low) .WithItem("egg", Importance.High) .Build(); srcTodoItem = todoList; }
public WhenTodoItemIsConvertedToEditFields() { var todoList = new TestTodoListBuilder(new IdentityUser("*****@*****.**"), "shopping") .WithItem("bread", Importance.High, 1) .Build() ; srcTodoItem = todoList.Items.First(); resultFields = TodoItemEditFieldsFactory.Create(srcTodoItem); }