title: Effort (EF Unit Testing) giving errors
body: <p>I am trying to do unit testing on some classes that reply on an Entity Framework DB Context. For help, I managed to find a library called Effort, which seems to be a little old, and not very well documented, but it seems to work, and seems to be quite popular.</p>
  
  <p>I am trying to use a CSV data loader.</p>
  
  <p>When doing a <code>ToArray()</code> I receive an exceptions saying <code>Sequence contains no matching element</code>.</p>
  
  <p>Any ideas on what I might be doing incorrectly? Or if not a different library I might want to give a chance?</p>
  
  <p>A few snippets:</p>
  
  <pre><code>[Table("SEC_USER")]
  public class SecUser {
      [Key][Column("USERID")]
      public int UserId { get; set; }
  
      [Column("USERNAME")]
      public string UserName { get; set; }
  }
  </code></pre>
  
  <p>DB Context:</p>
  
  <pre><code>public class MusketeerDbContext : DbContext
  {
      public virtual IDbSet&lt;IbsCommunity&gt; Communities { get; set; }
      public virtual IDbSet&lt;IbsFunctionLinkLocation&gt; Functionlinklocations { get; set; }
      public virtual IDbSet&lt;IbsInstance&gt; Instances { get; set; }
      public virtual IDbSet&lt;SecUser&gt; Users { get; set; }
      public virtual IDbSet&lt;IbsFieldType&gt; FieldTypes { get; set; }
      public virtual IDbSet&lt;IbsLink&gt; Links { get; set; }
      public virtual IDbSet&lt;IbsFieldFll&gt; FieldFlls { get; set; }
      public virtual IDbSet&lt;IbsFieldValue&gt; FieldValues { get; set; }
  
      public MusketeerDbContext() : base("name=EGS.My.MySettings.Conn") { }
      public MusketeerDbContext(DbConnection connection) : base(connection, true) { }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.HasDefaultSchema("SA");
          modelBuilder.Conventions.Add(new FunctionConvention(typeof(OracleFunctions)));
  
          modelBuilder.Entity&lt;IbsFieldValue&gt;()
              .HasMany(fv =&gt; fv.InstancesFieldValues)
              .WithMany(i =&gt; i.InstancesFieldValues)
              .Map(mm =&gt;
              {
                  mm.MapLeftKey("FIELDVALUEID");
                  mm.MapRightKey("INSTANCEID");
                  mm.ToTable("IBS_INSTANCEFIELDVALUE");
              });
      }
  }
  
  public static class OracleFunctions
  {
      [Function(FunctionType.BuiltInFunction, "TO_CHAR")]
      public static string ToChar(this int value) =&gt; Function.CallNotSupported&lt;string&gt;();
  
      [Function(FunctionType.BuiltInFunction, "TO_NCHAR")]
      public static string ToChar(this string value) =&gt; Function.CallNotSupported&lt;string&gt;();
  }
  </code></pre>
  
  <p>The SEC_USER.csv:</p>
  
  <pre><code>USERID,USERNAME
  "1","Jonathan"
  </code></pre>
  
  <p>The Test:</p>
  
  <pre><code>var path = @"C:\...\CSVs";
  var dataLoader = new Effort.DataLoaders.CsvDataLoader(path);
  var context = Effort.DbConnectionFactory.CreateTransient(dataLoader);
  db = new MusketeerDbContext(context);
  var users = db.Users.ToArray();
  </code></pre>
  
  <p>System.InvalidOperationException:</p>
  
  <pre><code>Message: "Sequence contains no matching element"
  InnerException: null
  StackTrace:
      at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
      at System.Data.Entity.Utilities.DbProviderManifestExtensions.GetStoreTypeFromName(DbProviderManifest providerManifest, String name)
      at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.ConfigureColumn(EdmProperty column, EntityType table, DbProviderManifest providerManifest)
      at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(EdmProperty column, EntityType table, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration)
      at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.&lt;&gt;c__DisplayClass4.&lt;Configure&gt;b__3(Tuple`2 pm)
      at System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable`1 ts, Action`1 action)
      at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(IEnumerable`1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration)
      at System.Data.Entity.ModelConfiguration.Configuration.Types.StructuralTypeConfiguration.ConfigurePropertyMappings(IList`1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride)
      at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigurePropertyMappings(DbDatabaseMapping databaseMapping, EntityType entityType, DbProviderManifest providerManifest, Boolean allowOverride)
      at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(EntityType entityType, DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
      at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.ConfigureEntityTypes(DbDatabaseMapping databaseMapping, ICollection`1 entitySets, DbProviderManifest providerManifest)
      at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure(DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
      at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
      at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
      at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
      at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
      at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
      at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
      at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
      at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
      at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable&lt;TResult&gt;.GetEnumerator()
      at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
      at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
      at Igs.Musketeer.DbRepository.Tests.SecurityRepositoryTest..ctor() in C:\Users\me\Source\Repos\Musketeer\Igs.Musketeer.DbRepositoryTests\SecurityRepositoryTest.cs:line 21
  </code></pre>