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