Exemple #1
0
        public void TodoListMarkElementsDone(string description, int numElements, int shouldBeMarkedDone)
        {
            var list = new TodoList();

            for (int i = 0; i < numElements; i++)
            {
                list.AddElement(description);
            }

            for (int i = 1; i <= shouldBeMarkedDone; i++)
            {
                list.DoElement(i.ToString());
            }

            var elements = list.GetTodoElements();

            int markedDone = 0;

            for (int i = 0; i < numElements; i++)
            {
                if (elements[i].IsDone())
                {
                    markedDone += 1;
                }
            }

            Assert.NotNull(list);
            Assert.AreEqual(shouldBeMarkedDone, markedDone);
        }
Exemple #2
0
        public void TodoListAddElementsMarkSomeDoneCreateNewListCheckState(string description, int numElements, int shouldBeMarkedDone)
        {
            var list = new TodoList();

            for (int i = 0; i < numElements; i++)
            {
                list.AddElement(description);
            }

            for (int i = 0; i < shouldBeMarkedDone; i++)
            {
                list.DoElement(i.ToString());
            }

            var elements = list.GetTodoElements();

            list = new TodoList();

            var reloadedElements = list.GetTodoElements();

            Assert.AreEqual(elements.Length, reloadedElements.Length);
            for (int i = 0; i < numElements; i++)
            {
                Assert.AreEqual(elements[0].GetDescription(), reloadedElements[0].GetDescription());
                Assert.AreEqual(elements[0].IsDone(), reloadedElements[0].IsDone());
            }
            Assert.NotNull(list);
        }
Exemple #3
0
        public void TodoListMarkDone(string description, string id)
        {
            var list = new TodoList();

            list.AddElement(description);
            list.DoElement(id);

            var elements = list.GetTodoElements();

            Assert.NotNull(list);
            Assert.IsTrue(elements[0].IsDone());
        }