コード例 #1
0
ファイル: PropertyCommandTests.cs プロジェクト: virajs/teclyn
        //[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);
        }
コード例 #2
0
ファイル: PropertyCommandTests.cs プロジェクト: virajs/teclyn
        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);
        }