Exemple #1
0
        public void StartCreationDoesNotInsertAnythingToTheDatabase()
        {
            // Arrange
            Mock.Arrange(() => _persistance.InsertAsync(new object())).Returns(Task.CompletedTask).OccursNever();

            // Act
            _storage.StartCreation();

            // Assert
            Mock.Assert(_persistance);
        }
        public void StartCreationAddsANewTaskToTheListWithAllTasksButNotToThestorage()
        {
            // Arrange
            Mock.Arrange(() => _persistance.InsertAsync(Arg.AnyObject)).OccursNever();

            // Act
            _taskService.StartCreation(null);

            // Assert
            Assert.AreEqual(1, _taskService.AllTasks.Count);
            Mock.Assert(_persistance);
        }