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