Пример #1
0
        public void SaveNew_Assert_CallsAdd()
        {
            IRepository <ToDoTasks, int> iRepository = Substitute.For <IRepository <ToDoTasks, int> >();
            ToDoTasks toDoTask = new ToDoTasks();

            ToDoTaskRepository toDoRepository = new ToDoTaskRepository(iRepository);

            toDoRepository.SaveNew(toDoTask);

            iRepository.Received().Add(toDoTask);
        }
Пример #2
0
        public void SaveNew_CorrectParameters_CallsSaveNew()
        {
            IRepository <ToDoTasks, int> iRepository = Substitute.For <IRepository <ToDoTasks, int> >();

            ToDoTasks toDoTask = new ToDoTasks
            {
                CheckedDone     = false,
                LastUpdated     = System.DateTime.Now,
                TaskDescription = "someDescription",
                TaskUserId      = 1,
                ToDoTaskId      = 1
            };

            ToDoTask toDoTasks = new ToDoTask(iRepository);

            ToDoTaskRepository toDoTaskRepo = new ToDoTaskRepository(iRepository);

            toDoTaskRepo.SaveNew(toDoTask);

            iRepository.Received().Add(toDoTask);
        }
Пример #3
0
        public void SaveNew(ToDoTasks newTask)
        {
            ToDoTaskRepository toDoTask = new ToDoTaskRepository(this.iRepository);

            toDoTask.SaveNew(newTask);
        }