コード例 #1
0
        public void ToIdExists_False()
        {
            MockTodoRepository mockObj    = new MockTodoRepository();
            List <ToDo>        getAllTodo = mockObj.getAllTodo();
            bool isExist = ValidateUtility.ToDoIdExists(getAllTodo, 12);

            Assert.AreEqual(false, isExist);
        }
コード例 #2
0
        public void Test_ToDoExists_False()
        {
            MockTodoRepository mockToDoObj = new MockTodoRepository();
            ToDoController     tc          = new ToDoController(mockToDoObj);
            bool apiResponse = ValidateUtility.ToDoIdExists(TodoTestData.GetMockAllToDo(), 50);

            Assert.IsFalse(apiResponse);
        }
コード例 #3
0
        public void Test_ToDoExists_True()
        {
            bool apiResponse = ValidateUtility.ToDoIdExists(TodoTestData.GetMockAllToDo(), 2);

            Assert.IsTrue(apiResponse);
        }
コード例 #4
0
 /// <summary>
 /// Method to check if item already exist in the database for the given id
 /// </summary>
 /// <param name="id"></param>
 /// <returns>true if value exist, false if value doesnt exist</returns>
 public bool ToDoIdExists(int id)
 {
     return(ValidateUtility.ToDoIdExists(_repository.getAllTodo(), id));
 }