コード例 #1
0
        public WhenTodoListDetailIsCreated()
        {
            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();

            resultFields = TodoListDetailViewmodelFactory.Create(srcTodoList, false, false);
        }
コード例 #2
0
        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);
        }
コード例 #4
0
        public WhenTodoListDetailHidesDone()
        {
            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();

            srcTodoList.Items.FirstOrDefault().IsDone = true;

            resultFields = TodoListDetailViewmodelFactory.Create(srcTodoList, true, false);
        }
        public WhenTodoListDetailOrderedByRank()
        {
            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();

            srcTodoList.Items.ElementAt(0).Rank = 5;
            srcTodoList.Items.ElementAt(1).Rank = 4;
            srcTodoList.Items.ElementAt(2).Rank = 3;
            srcTodoList.Items.ElementAt(3).Rank = 2;
            srcTodoList.Items.ElementAt(4).Rank = 1;


            resultFields = TodoListDetailViewmodelFactory.Create(srcTodoList, hideDone: false, orderByRank: true);
        }