Hi,
Using ToQueryText thus:
dataService.Arrange(
ds => ds.DeleteEntitiesDirectlty<HubexRollbackStateEntity>(Arg.Matches((Predicate p) => p.ToQueryText().Equals((HubexRollbackStateFields.Key == 1).ToQueryText())), Arg.AnyString)).OccursOnce();
Gives
System.ApplicationException : DatabaseSpecificCreator object not set. Cannot create query part.
at SD.LLBLGen.Pro.ORMSupportClasses.FieldCompareValuePredicate.ToQueryText(Boolean inHavingClause) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\QueryApiElements\FieldCompareValuePredicate.cs: line 262
at lambda_method(Closure, Predicate)
which no doubt could be worked around with more code in the unit test.
Testing the values explicitly like this:
dataService.Arrange(
ds => ds.DeleteEntitiesDirectlty<HubexRollbackStateEntity>(Arg.Matches((FieldCompareValuePredicate p) => p.Field == HubexRollbackStateFields.Key && p.Value == (object)1), Arg.AnyString)).OccursOnce();
Gives
System.InvalidOperationException : This object was constructed using a non-selfservicing constructor. Can't retrieve an IEntityField after that.
at SD.LLBLGen.Pro.ORMSupportClasses.FieldCompareValuePredicate.get_Field() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\QueryApiElements\FieldCompareValuePredicate.cs: line 511
at lambda_method(Closure, FieldCompareValuePredicate)
I dont use self-servicing, so the first part of the message is correct, but I don't know why it complains about retrieving IEntityField.
Looks like to get this expectation to work I'll need more code which is a shame as I don't like to clutter up the unit test.