Beispiel #1
0
        public void ListControllerTest()
        {
            // Arrange
            MockRepo       repo = new MockRepo();
            ListController ctrl = new ListController(repo);
            // Act
            IEnumerable <IListItem> testList = ctrl.GetListItems();
            int size = testList.Count();

            // Assert
            Assert.AreEqual(size, 2);
        }
Beispiel #2
0
        public void AddItemTest()
        {
            // Arrange
            MockRepo                repo      = new MockRepo();
            ListController          ctrl      = new ListController(repo);
            IEnumerable <IListItem> testList1 = ctrl.GetListItems();
            int size1 = testList1.Count();

            // Act
            ctrl.AddItem(new ToDoItem("test 333"));
            IEnumerable <IListItem> testList2 = ctrl.GetListItems();
            int size2 = testList2.Count();

            // Assert
            Assert.AreEqual(size1 + 1, size2);
        }