Ejemplo n.º 1
0
        public void FindUnassigned_FindOnlyOne_Arraysize1()
        {
            //arrange
            int    personId   = PersonSequencer.getNext();
            string firstName  = "Fredrik";
            string familyName = "Persson";
            Person assignee   = new Person(personId, firstName, familyName);

            personId = PersonSequencer.getNext();
            Person assignee2 = new Person(personId, "Clara", familyName);

            string description1 = "Walk the dog.";
            string description2 = "Cuddle with cat.";
            string description3 = "Take a walk.";

            ToDoSequencer.Reset();
            ToDoItems todoItems = new ToDoItems();

            todoItems.Clear();

            //add 3 items
            todoItems.AddToDoItem(assignee, description1);
            todoItems.AddToDoItem(assignee2, description2);
            todoItems.AddToDoItem(null, description3);

            //act
            ToDo[] foundItemsArray = todoItems.FindUnassignedTodoItems();

            //assert
            Assert.Single(foundItemsArray);
            Assert.Equal(description3, foundItemsArray[0].Description);
        }