예제 #1
0
        public void ThrowsOnEntityThatDoesNotImplementIEntityButSharesInterface()
        {
            var validator = new EntityValidator();

            Assert.Throws <MalformedResourceEntityException>
            (
                () => validator.ValidateResourceEntity(typeof(EntityThatDoesNotImplementIEntityButSharesInterface))
            );
        }
예제 #2
0
        public void ThrowsOnEntityWithUnexpectedOrderInConstructor()
        {
            var validator = new EntityValidator();

            Assert.Throws <MalformedResourceEntityException>
            (
                () => validator.ValidateResourceEntity(typeof(EntityWithUnexpectedOrderInConstructor))
            );
        }
예제 #3
0
        public void ThrowsOnEntityWithMultipleConstructors()
        {
            var validator = new EntityValidator();

            Assert.Throws <MalformedResourceEntityException>
            (
                () => validator.ValidateResourceEntity(typeof(EntityWithMultipleConstructors))
            );
        }
예제 #4
0
        public void ThrowsOnEntityWithPrivateSetterProperties()
        {
            var validator = new EntityValidator();

            Assert.Throws <MalformedResourceEntityException>
            (
                () => validator.ValidateResourceEntity(typeof(EntityWithPrivateSetterProperties))
            );
        }
예제 #5
0
        public void ThrowsOnEntityWithFieldsAndPropertiesInConstructor()
        {
            var validator = new EntityValidator();

            Assert.Throws <MalformedResourceEntityException>
            (
                () => validator.ValidateResourceEntity(typeof(EntityWithFieldsAndPropertiesInConstructor))
            );
        }
예제 #6
0
        public void ThrowsOnEntityWithOnlyFields()
        {
            var validator = new EntityValidator();

            Assert.Throws <MalformedResourceEntityException>
            (
                () => validator.ValidateResourceEntity(typeof(EntityWithOnlyFields))
            );
        }
예제 #7
0
        public void ValidatesEntityWithOnlyMethods()
        {
            var validator = new EntityValidator();

            validator.ValidateResourceEntity(typeof(EntityWithOnlyMethods));
        }
예제 #8
0
        public void ValidatesEmptyEntity()
        {
            var validator = new EntityValidator();

            validator.ValidateResourceEntity(typeof(EmptyEntity));
        }
예제 #9
0
        public void ValidatesValidEntityWithManyProperties()
        {
            var validator = new EntityValidator();

            validator.ValidateResourceEntity(typeof(ValidEntityWithManyProperties));
        }
예제 #10
0
        public void ValidatesEntityWithPropertiesAndMethods()
        {
            var validator = new EntityValidator();

            validator.ValidateResourceEntity(typeof(EntityWithPropertiesAndMethods));
        }