public void it_should_make_a_message() { string type = "SAMPLE"; StringIsNotNullValidator payload = new StringIsNotNullValidator(); Message message = this.factory.Make(type, payload); Assert.Equal(type, message.Type); Assert.Equal(payload, message.Payload); }
public void it_should_not_Add_same_validator_twice() { ValueValidator validator = new StringIsNotNullValidator(); this.validators.Add(sampleKey, validator); this.validators.Add(sampleKey, validator); int count = this.validators.Get(sampleKey).Count(); Assert.Equal(1, count); Assert.Contains(validator, this.validators.Get(sampleKey)); }
public void it_should_Add_validator() { ValueValidator validator = new StringIsNotNullValidator(); this.validators.Add(sampleKey, validator); int count = this.validators.Get(sampleKey).Count(); Assert.Equal(1, count); Assert.Contains(validator, this.validators.Get(sampleKey)); validator = new ExceptionValueValidator(); this.validators.Add(sampleKey, validator); count = this.validators.Get(sampleKey).Count(); Assert.Equal(2, count); Assert.Contains(validator, this.validators.Get(sampleKey)); }
public StringIsNotNullValidatorTests() { this.validator = new StringIsNotNullValidator(); }