public static CenterStatus CreateNew(int depth = 0) { rt.fias.model.fias.CenterStatus entity = new rt.fias.model.fias.CenterStatus(); entity.Name = "Test Test "; return(entity); }
public void Create() { try { rt.fias.model.fias.CenterStatus entity = CreateNew(); object result = manager.Save(entity); Assert.IsNotNull(result); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }
public void Read() { try { rt.fias.model.fias.CenterStatus entityA = CreateNew(); manager.Save(entityA); rt.fias.model.fias.CenterStatus entityB = manager.GetById(entityA.Id); Assert.AreEqual(entityA, entityB); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }
public void Delete() { try { rt.fias.model.fias.CenterStatus entityC = CreateNew(); manager.Save(entityC); manager.Session.GetISession().Flush(); manager.Session.GetISession().Clear(); rt.fias.model.fias.CenterStatus entity = GetFirstCenterStatus(); manager.Delete(entity); entity = manager.GetById(entity.Id); Assert.IsNull(entity); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }
public void Update() { try { rt.fias.model.fias.CenterStatus entityC = CreateNew(); manager.Save(entityC); manager.Session.GetISession().Flush(); manager.Session.GetISession().Clear(); rt.fias.model.fias.CenterStatus entityA = GetFirstCenterStatus(); entityA.Name = "Test Test "; manager.Update(entityA); rt.fias.model.fias.CenterStatus entityB = manager.GetById(entityA.Id); Assert.AreEqual(entityA.Name, entityB.Name); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }