public void ModelKeys1() { var keys = EntityFrameworkHelper.PrimaryKeyNames <SingleKey>(); Assert.That(keys, Has.Count.EqualTo(1)); Assert.AreEqual(keys.First(), "StudentKey"); }
public void ModelKeys2() { var keys = EntityFrameworkHelper.PrimaryKeyNames <DoubleKey>(); Assert.That(keys, Has.Count.EqualTo(2)); Assert.AreEqual(keys.First(), "StudentKey"); Assert.AreEqual(keys.Last(), "AdmissionNum"); }
public void ModelKeys3() { var keys = EntityFrameworkHelper.PrimaryKeyNames <TripleKey>(); Assert.That(keys, Has.Count.EqualTo(3)); Assert.AreEqual(keys.First(), "StudentKey"); Assert.AreEqual(keys.Skip(1).First(), "AdmissionNum"); Assert.AreEqual(keys.Last(), "Guid"); }
public void VerifyCompositeKey_EF_Metadata() { using IWindsorContainer c = new WindsorContainer(); c.AddDbContext <SampleContext>() .UseInMemory(); var ctx = c.Resolve <SampleContext>(); var names = EntityFrameworkHelper.PrimaryKeyNames <CompositeStringKey>(ctx); Assert.That(names.Count() == 2); Assert.AreEqual(names.First(), "Id"); Assert.AreEqual(names.Last(), "Name"); }
public void ModelKeys0() { var keys = EntityFrameworkHelper.PrimaryKeyNames <EntityKeyExpressionTests>(); Assert.That(keys, Has.Count.Zero); }