public void SaveConfigurationShouldReturnValueUpdated() { var manager = new MyEntityManager(contextGenerator); var entity = manager.GetMyEntity(); entity.Name = "TEST UPDATE"; manager.SaveMyEntity(entity); var entitySaved = manager.GetMyEntity(); Assert.NotNull(entity); Assert.NotNull(entitySaved); Assert.AreEqual(entity.Name, entitySaved.Name); Assert.AreEqual("TEST UPDATE", entitySaved.Name); }
public void GetMyEntityShouldReturnEntity() { var contextGenerator = new DbContextGenerator(options); var manager = new MyEntityManager(contextGenerator); var entity = manager.GetMyEntity(); Assert.NotNull(entity); Assert.AreEqual(1, entity.Id); }
public void GetConfigurationShouldReturnConfig() { var manager = new MyEntityManager(contextGenerator); var entity = manager.GetMyEntity(); Assert.NotNull(entity); Assert.AreEqual(1, entity.Id); Assert.AreEqual("TEST NAME", entity.Name); }
public void SaveMyEntityShouldReturnValueUpdated() { var contextGenerator = new DbContextGenerator(options); var manager = new MyEntityManager(contextGenerator); const string nameToUpdate = "INTEGRATION TEST"; var entity = manager.GetMyEntity(); var originalValue = entity.Name; entity.Name = nameToUpdate; manager.SaveMyEntity(entity); var entitySaved = manager.GetMyEntity(); Assert.NotNull(entity); Assert.NotNull(entitySaved); Assert.AreEqual(entity.Name, entitySaved.Name); Assert.AreEqual(nameToUpdate, entitySaved.Name); entitySaved.Name = originalValue; manager.SaveMyEntity(entitySaved); }