markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

InMemoryAdapter fails with .Lower() #304

Open dorr-godaddy opened 11 years ago

dorr-godaddy commented 11 years ago

re: https://groups.google.com/forum/#!topic/simpledata/FGKUvacaOJ0

Here is my query: var results = Db.Customers.FindAll(Db.Customers.DomainName.Lower() == domain.ToLower()).ToList();

Here is my unit test: public void GetCustomerByPrimaryDomainTest() { var fixture = new Fixture(); var customers = fixture.CreateMany(5).ToList(); var expectedCustomer = customers[2]; var expectedCustomerLikeness = new Likeness<Customer, Customer>(expectedCustomer); foreach (var customer in customers) { InMemoryDatabase.Customers.Insert(customer); }

 var actualCustomer = DataAccess.GetCustomerByPrimaryDomain(expectedCustomer.DomainName);

 expectedCustomerLikeness.ShouldEqual(actualCustomer);

}

This succeeds against an actual database, but not using the InMemoryAdapter. If I remove the .Lower and .ToLower clause, the test works as expected.