public void FieldsParameter003() { // Arrange bool actual; string dummy; var expressionCache = new ExpressionCache <TestDocumentWithAttribute>(); var expressionBuilder = (IExpressionBuilder <TestDocumentWithAttribute>) new ExpressionBuilder <TestDocumentWithAttribute>(expressionCache); var parameter = new FieldsParameter <TestDocumentWithAttribute>(expressionBuilder); parameter.Configure(q => q.Stored, q => q.NotStored); // Act parameter.Validate(out actual, out dummy); // Assert Assert.False(actual); }
public void FieldsParameter006() { // Arrange bool isValid; string errorMessage; var expressionCache = new ExpressionCache <TestDocumentWithAttribute>(); var expressionBuilder = (IExpressionBuilder <TestDocumentWithAttribute>) new ExpressionBuilder <TestDocumentWithAttribute>(expressionCache); var parameter = new FieldsParameter <TestDocumentWithAttribute>(expressionBuilder); parameter.Configure(q => q.Stored); // Act parameter.Validate(out isValid, out errorMessage); // Assert Assert.True(isValid); }
public void FieldsParameter007() { // Arrange bool isValid; string errorMessage; var expressionCache = new ExpressionCache <TestDocumentWithAttribute>(); var expressionBuilder = (IExpressionBuilder <TestDocumentWithAttribute>) new ExpressionBuilder <TestDocumentWithAttribute>(expressionCache); var parameter = new FieldsParameter <TestDocumentWithAttribute>(expressionBuilder); parameter.Configure(q => q.NotStored); // Act parameter.Validate(out isValid, out errorMessage); // Assert Assert.False(isValid); Assert.Equal(Resource.FieldMustBeStoredTrueToBeUsedInFieldsException, errorMessage); }