コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 public StringIsNotNullValidatorTests()
 {
     this.validator = new StringIsNotNullValidator();
 }