Beispiel #1
0
        public void IsItemCreationPossible_LastItemCreatedTenMinutesAgo()
        {
            ToDoList toDoList = new ToDoList();

            IItem itemCreatedTenMinutesAgo = this.GetMockIItem(isValid: true, creationDate: DateTime.Now.Subtract(new TimeSpan(0, 10, 0)));

            toDoList.AddItem(itemCreatedTenMinutesAgo);

            Assert.IsFalse(toDoList.IsItemCreationPossible());
        }
Beispiel #2
0
        public void IsItemCreationPossible()
        {
            ToDoList toDoList = new ToDoList();

            IItem itemCreatedTwoHoursAgo = this.GetMockIItem(isValid: true, creationDate: DateTime.Now.Subtract(new TimeSpan(2, 0, 0)));

            toDoList.AddItem(itemCreatedTwoHoursAgo);
            IItem itemCreatedOneHoursAgo = this.GetMockIItem(isValid: true, creationDate: DateTime.Now.Subtract(new TimeSpan(1, 0, 0)));

            toDoList.AddItem(itemCreatedOneHoursAgo);

            Assert.IsTrue(toDoList.IsItemCreationPossible());
        }
Beispiel #3
0
        public void IsItemCreationPossible_TenItemsOrMoreInTheList()
        {
            ToDoList toDoList = new ToDoList();

            for (int i = 0; i < 10; i += 1)
            {
                IItem item = this.GetMockIItem(isValid: true);
                toDoList.AddItem(item);

                Assert.IsTrue(toDoList.items.Contains(item));
            }

            Assert.IsFalse(toDoList.IsItemCreationPossible());
        }