コード例 #1
0
        public void CanReturnIModelStateDictionary()
        {
            // Arrange
            ValidatorTestObject validatorTestObject = new ValidatorTestObject {
                Name = "123456"
            };

            // Act
            IValidationResults actual = this.validator.Validate(validatorTestObject);

            // Assert
            Assert.IsTrue(actual.ContainsKey <ValidatorTestObject>(w => w.Name));
        }
コード例 #2
0
        public void CanReturnIModelStateDictionary()
        {
            // Arrange
            YummySausageSalad yummySausageSalad = new YummySausageSalad {
                Name = "123456"
            };
            Validator <YummySausageSalad> validator = new Validator <YummySausageSalad>();

            // Act
            IValidationResults actual = validator.Validate(yummySausageSalad);

            // Assert
            Assert.IsTrue(actual.ContainsKey <YummySausageSalad>(w => w.Name));
        }