Exemplo n.º 1
0
        public async Task Setting_DefinitionOfDone_ShouldCreateProjection(string definitionOfDone)
        {
            // Arrange
            using (var connection = this._testInfrastructure.OpenDatabaseConnection())
            {
                // Arrange
                var commandDispatcher = this._testInfrastructure.DiContainer.GetInstance <IMediator>();
                var repository        = new TaskRepository();
                var newTask           = await this.CreateNewTask();

                // Act
                var definitionOfDoneCommand = new AssignDefinitionOfDoneCommand(newTask.TaskId, definitionOfDone);
                await commandDispatcher.Send(definitionOfDoneCommand);

                // Assert
                var projection = await repository.GetByIdAsync(connection, newTask.TaskId);

                // Assert
                Assert.That(projection.DefinitionOfDone, Is.Not.Null);
                Assert.That(projection.DefinitionOfDone, Is.EqualTo(definitionOfDone));
            }
        }