public void CommandValidator_rules_based_on_data_annotations_attributes_are_cached() { var command1 = new CommandWithDataAnnotations(); var command2 = new CommandWithDataAnnotations(); command1.CommandValidator.Should().BeSameAs(command2.CommandValidator); }
public void Default_CommandValidator_uses_DataAnnotations() { var command = new CommandWithDataAnnotations(); var aggregate = new FakeAggregateWithEnactCommandConvention(); var report = aggregate.Validate(command); report .Failures .Should() .Contain(f => f.MemberPath == "Name"); }