Beispiel #1
0
 public void EfCanHaneleRelationshipsWithoutExplicitIDpropertiesForForeignKey()
 {
     using (var context = new ThingieContext())
     {
         var thing = context.Things.FirstOrDefault();
         Assert.IsNotNull(thing.Relationship);
         Assert.AreEqual(41, thing.Relationship.Id);
     }
 }
Beispiel #2
0
 public void EfCanPopulateObjectWithPrivateCtorAndSetters()
 {
     using (var context = new ThingieContext())
     {
         var thing = context.Things.FirstOrDefault();
         Assert.IsInstanceOfType(thing, typeof(AThingAsEntity));
         Assert.AreNotEqual(0, thing.Id);
         Assert.IsFalse(string.IsNullOrEmpty(thing.Description));
         Assert.IsFalse(string.IsNullOrEmpty(thing.SomeOtherThing.AnotherValue));
     }
 }