public void Create() { try { rt.atl.model.atl.Przlog 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.Przlog entityA = CreateNew(); manager.Save(entityA); rt.atl.model.atl.Przlog entityB = manager.GetById(entityA.Id); Assert.AreEqual(entityA, entityB); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }
public void Delete() { try { rt.atl.model.atl.Przlog entityC = CreateNew(); manager.Save(entityC); manager.Session.GetISession().Flush(); manager.Session.GetISession().Clear(); rt.atl.model.atl.Przlog entity = GetFirstPrzlog(); manager.Delete(entity); entity = manager.GetById(entity.Id); Assert.IsNull(entity); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }
public static Przlog CreateNew(int depth = 0) { rt.atl.model.atl.Przlog entity = new rt.atl.model.atl.Przlog(); entity.Filename = "Test Test Test Test Te"; entity.Q = "Tes"; entity.Prz = "Test T"; entity.Mm = 45; entity.Gg = 40; entity.Zz = 73; entity.Dtin = System.DateTime.Now; entity.Dtout = System.DateTime.Now; entity.Reccount = 27; entity.Tpfile = "Test T"; entity.Nerr = 29; entity.Nz = 77; entity.Errfile = "Test Test "; entity.St = 86; entity.Vers = "Te"; return(entity); }
public void Update() { try { rt.atl.model.atl.Przlog entityC = CreateNew(); manager.Save(entityC); manager.Session.GetISession().Flush(); manager.Session.GetISession().Clear(); rt.atl.model.atl.Przlog entityA = GetFirstPrzlog(); entityA.Filename = "Test Test Test Test Test Test Test Test Test T"; manager.Update(entityA); rt.atl.model.atl.Przlog entityB = manager.GetById(entityA.Id); Assert.AreEqual(entityA.Filename, entityB.Filename); } catch (Exception ex) { Assert.Fail(ex.ToString()); } }