public void BasicAddEntity() { AnEntity GianMaria = AnEntity.Create(10, "Gian Maria", 200); AnEntitySut.Save(GianMaria); Assert.That(EntityIdFinder.GetIdValueFromEntity(GianMaria), Is.Not.EqualTo(10)); }
public void TestIdFinderWithFieldPublic() { PublicIdEntity entity = PublicIdEntity.Create(10); Object id = EntityIdFinder.GetIdValueFromEntity(entity); Assert.That(id, Is.TypeOf(typeof(Int32))); Assert.That(id, Is.EqualTo(10)); }
public void TestIdFinder() { AnEntity entity = AnEntity.CreateWithIdOnly(10); Object id = EntityIdFinder.GetIdValueFromEntity(entity); Assert.That(id, Is.TypeOf(typeof(Int32))); Assert.That(id, Is.EqualTo(10)); }
public void TestIdFinderForNoIdEntity() { IdNotNamedId entity = IdNotNamedId.Create(); Object id = EntityIdFinder.GetIdValueFromEntity(entity); }
public void Save(T obj) { EntityIdFinder.SetIdValueForEntity(obj); context.Add(EntityIdFinder.GetIdValueFromEntity(obj), obj); }