I'm looking to unit testing some methods using Entity Framework 6 using the instructions provided here.
My set-up is slightly different though - I'm also using ASP.Net Identity (the default implementation that uses EF). As such my context inherits from IdentityDbContext.
When I run the tests I get an exception with the following details:
Castle.Proxies.IdentityUserLogin: : EntityType 'IdentityUserLogin' has no key defined. Define the key for this EntityType.
Castle.Proxies.IdentityUserRole: : EntityType 'IdentityUserRole' has no key defined. Define the key for this EntityType.
IdentityUserLogins: EntityType: EntitySet 'IdentityUserLogins' is based on type 'IdentityUserLogin' that has no keys defined.
IdentityUserRoles: EntityType: EntitySet 'IdentityUserRoles' is based on type 'IdentityUserRole' that has no keys defined.
I've read that in normal uses these are set up in the default OnModelCreating method.
But can anyone offer advice on handling this within the mocked context illustrated in the method linked to above?
Thanks
Andy