public void CanGetAllObject() { //CmsPageSecurityZoneUserRole role = new CmsPageSecurityZoneUserRole(); PageSecurityZoneUserRoleRepository repository = new PageSecurityZoneUserRoleRepository(); IList <CmsPageSecurityZoneUserRole> rolelist = repository.GetAll(); Assert.That(rolelist.Count, Is.EqualTo(4)); }
public void CanQueryByZoneID() { PageSecurityZoneUserRoleRepository repository = new PageSecurityZoneUserRoleRepository(); CmsPageSecurityZoneUserRoleDb dboperation = new CmsPageSecurityZoneUserRoleDb(); CmsPageSecurityZone z = new CmsPageSecurityZone(2); //z.Id = 2; List <CmsPageSecurityZoneUserRole> resultlist = dboperation.fetchAllByZone(z); Assert.That(resultlist.Count, Is.EqualTo(2)); }
public void CanInsertObject() { PageSecurityZoneUserRoleRepository repository = new PageSecurityZoneUserRoleRepository(); CmsPageSecurityZoneUserRoleDb dboperation = new CmsPageSecurityZoneUserRoleDb(); CmsPageSecurityZoneUserRole insertobject = new CmsPageSecurityZoneUserRole(1, 2, true, false); CmsPageSecurityZoneUserRole insertobject2 = new CmsPageSecurityZoneUserRole(2, 2, false, false); List <CmsPageSecurityZoneUserRole> objectlist = new List <CmsPageSecurityZoneUserRole>(); objectlist.Add(insertobject); objectlist.Add(insertobject2); if (dboperation.insert(objectlist) == false) { throw new Exception("insert test fail"); } //CmsPageSecurityZoneUserRole returnobject = repository.SaveOrUpdate(insertobject); //Assert.That(repository, Is.Not.Null); }
public CmsPageSecurityZoneUserRoleDb() { repository = new PageSecurityZoneUserRoleRepository(); }