public void TodoIDTest2()
        {
            // This method test that Todo ID is getting incremented by nextToDoId().
            //Arrange
            int expectedTodoIdValue = 0;
            int actualTodoIDValue   = 0;

            //Act
            TodoSequencer.reset();
            TodoSequencer.nextToDoId();
            actualTodoIDValue = TodoSequencer.todoId;
            expectedTodoIdValue++;

            //Assert
            Assert.Equal(expectedTodoIdValue, actualTodoIDValue);
        }
        public void TodoIDTest3()
        {
            // This method test that Todo ID is getting reset to 0 by reset().

            //Arrange
            int expectedTodoIdValue = 0;
            int actualTodoIDValue   = 0;

            //Act
            TodoSequencer.nextToDoId(); //sets a non zero toDoId value
            TodoSequencer.reset();
            actualTodoIDValue = TodoSequencer.todoId;

            //Assert
            Assert.Equal(expectedTodoIdValue, actualTodoIDValue);
        }
Exemplo n.º 3
0
 //constructors
 public Todo(string description)
 {
     todoId           = TodoSequencer.nextToDoId();
     this.Description = description;
 }