public void NonSerializedAttributeCausesInvalidOperation()
        {
            IQueryable<QueryValidatorSampleClass> query = new QueryValidatorSampleClass[0].AsQueryable();

            Assert.Throws<InvalidOperationException>(
                () => _queryValidator.Validate(query.Where((sample) => sample.NonSerializedAttributeField == 0)),
                "The property or field 'NonSerializedAttributeField' in type 'QueryValidatorSampleClass' is not accessible.");
        }
        public void IgnoreDataMemberAttributeCausesInvalidOperation()
        {
            IQueryable<QueryValidatorSampleClass> query = new QueryValidatorSampleClass[0].AsQueryable();

            Assert.Throws<InvalidOperationException>(
                () => _queryValidator.Validate(query.Where((sample) => sample.IgnoreDataMemberProperty == 0)),
                "The property or field 'IgnoreDataMemberProperty' in type 'QueryValidatorSampleClass' is not accessible.");
        }
        public void NonSerializedAttributeCausesInvalidOperation()
        {
            IQueryable <QueryValidatorSampleClass> query = new QueryValidatorSampleClass[0].AsQueryable();

            Assert.Throws <InvalidOperationException>(
                () => _queryValidator.Validate(query.Where((sample) => sample.NonSerializedAttributeField == 0)),
                "The property or field 'NonSerializedAttributeField' in type 'QueryValidatorSampleClass' is not accessible.");
        }
        public void IgnoreDataMemberAttributeCausesInvalidOperation()
        {
            IQueryable <QueryValidatorSampleClass> query = new QueryValidatorSampleClass[0].AsQueryable();

            Assert.Throws <InvalidOperationException>(
                () => _queryValidator.Validate(query.Where((sample) => sample.IgnoreDataMemberProperty == 0)),
                "The property or field 'IgnoreDataMemberProperty' in type 'QueryValidatorSampleClass' is not accessible.");
        }
        public void NormalFieldAccessDoesnotThrow()
        {
            IQueryable<QueryValidatorSampleClass> query = new QueryValidatorSampleClass[0].AsQueryable();

            _queryValidator.Validate(query.Where((sample) => sample.PublicField == 0));
        }
        public void NormalFieldAccessDoesnotThrow()
        {
            IQueryable <QueryValidatorSampleClass> query = new QueryValidatorSampleClass[0].AsQueryable();

            _queryValidator.Validate(query.Where((sample) => sample.PublicField == 0));
        }