Example #1
0
        public void generic_get_should_return_object_instance_value()
        {
            ExceptionValueValidator value = new ExceptionValueValidator();
            Message message = new Message(this.key, value);

            this.store.Dispatch(message);

            this.provider.setStore(this.store);
            this.provider.setKey(this.key);
            ExceptionValueValidator actual =
                this.provider.get <ExceptionValueValidator>();

            Assert.Equal(value, actual);
        }
        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 ExceptionValueValidatorTests()
 {
     this.validator = new ExceptionValueValidator();
 }