Exemplo n.º 1
0
        public async Task ConfirmCreatingTaskInsertsTheTaskToTheDatabaseAndWillNotCallAnyUpdate()
        {
            // Arrange
            Mock.Arrange(() => _persistance.InsertAsync(Arg.AnyObject)).Returns(Task.CompletedTask).OccursOnce();
            Mock.Arrange(() => _persistance.UpdateAsync(Arg.AnyObject)).OccursNever();
            Mock.Arrange(() => _modelFactory.CreateTaskModel(_habitViewModel)).Returns(new Model());

            // Act
            _taskService.StartCreation(null);
            var task = _taskService.AllTasks[0];
            await _taskService.ConfirmCreationAsync(task);

            // Assert
            Mock.Assert(_persistance);
        }