Ejemplo n.º 1
0
        //[Fact]
        public async Task PropertyCommandIsExecuted()
        {
            var newValue = "newValue";

            var command = new UpdateDummyValueCommand
            {
                AggregateId = aggregateId,
                NewValue    = newValue
            };

            var result = await command.Execute(this.commandService);

            Assert.True(result.Success);
            Assert.True(result.ContextIsValid);
            Assert.True(result.ParametersAreValid);
            Assert.False(result.Errors.Any());
            Assert.Equal(newValue, this.aggregate.Value);
        }
Ejemplo n.º 2
0
        public async Task ResultWithBadParameterFails()
        {
            var oldValue = this.aggregate.Value;
            var newValue = string.Empty;

            var command = new UpdateDummyValueCommand
            {
                AggregateId = aggregateId,
                NewValue    = newValue
            };

            var result = await command.Execute(this.commandService);

            Assert.False(result.Success);
            Assert.False(result.ParametersAreValid);
            Assert.True(result.ContextIsValid);
            Assert.True(result.Errors.Any());
            Assert.Equal(oldValue, this.aggregate.Value);
            Assert.NotEqual(newValue, this.aggregate.Value);
        }