public void Status_Fetch_Info_List() { StatusTestHelper.StatusAdd(); StatusTestHelper.StatusAdd(); var statuss = StatusRepository.StatusFetchInfoList(new StatusDataCriteria()); Assert.IsTrue(statuss.Count() > 1, "Row returned should be greater than one"); }
public void Status_Fetch() { var status = StatusTestHelper.StatusNew(); status = StatusRepository.StatusSave(status); status = StatusRepository.StatusFetch(status.StatusId); Assert.IsTrue(status != null, "Row returned should not equal null"); }
public void Status_Add() { var status = StatusTestHelper.StatusNew(); Assert.IsTrue(status.IsValid, "IsValid should be true"); status = StatusRepository.StatusSave(status); Assert.IsTrue(status.StatusId != 0, "StatusId should be a non-zero value"); StatusRepository.StatusFetch(status.StatusId); }
public void Status_Add_With_Duplicate_Name() { var status = StatusTestHelper.StatusNew(); var name = status.Name; StatusRepository.StatusSave(status); status = StatusRepository.StatusNew(); status.ProjectId = status.ProjectId; status.Name = name; Assert.IsTrue( ValidationHelper.ContainsRule(status, "rule://epiworx.business.statusduplicatenamecheck/Name"), "Name should not be duplicated"); }
public void Status_Edit() { var status = StatusTestHelper.StatusNew(); var name = status.Name; Assert.IsTrue(status.IsValid, "IsValid should be true"); status = StatusRepository.StatusSave(status); status = StatusRepository.StatusFetch(status.StatusId); status.Name = DataHelper.RandomString(20); status = StatusRepository.StatusSave(status); status = StatusRepository.StatusFetch(status.StatusId); Assert.IsTrue(status.Name != name, "Name should have different value"); }
public void Status_Delete() { var status = StatusTestHelper.StatusNew(); Assert.IsTrue(status.IsValid, "IsValid should be true"); status = StatusRepository.StatusSave(status); status = StatusRepository.StatusFetch(status.StatusId); StatusRepository.StatusDelete(status.StatusId); try { StatusRepository.StatusFetch(status.StatusId); } catch (Exception ex) { Assert.IsTrue(ex.GetBaseException() is InvalidOperationException); } }