public void Week_Fetch() { var week = WeekTestHelper.WeekNew(); week = WeekRepository.WeekSave(week); week = WeekRepository.WeekFetch(week.WeekId); Assert.IsTrue(week != null, "Row returned should not equal null"); }
public void Week_Add() { var week = WeekTestHelper.WeekNew(); Assert.IsTrue(week.IsValid, "IsValid should be true"); week = WeekRepository.WeekSave(week); Assert.IsTrue(week.WeekId != 0, "WeekId should be a non-zero value"); WeekRepository.WeekFetch(week.WeekId); }
public void Week_Edit() { var week = WeekTestHelper.WeekNew(); var name = week.StartDate; Assert.IsTrue(week.IsValid, "IsValid should be true"); week = WeekRepository.WeekSave(week); week = WeekRepository.WeekFetch(week.WeekId); week.StartDate = week.StartDate.AddDays(1); week = WeekRepository.WeekSave(week); week = WeekRepository.WeekFetch(week.WeekId); Assert.IsTrue(week.StartDate != name, "Name should have different value"); }
public void Week_Delete() { var week = WeekTestHelper.WeekNew(); Assert.IsTrue(week.IsValid, "IsValid should be true"); week = WeekRepository.WeekSave(week); week = WeekRepository.WeekFetch(week.WeekId); WeekRepository.WeekDelete(week.WeekId); try { WeekRepository.WeekFetch(week.WeekId); } catch (Exception ex) { Assert.IsTrue(ex.GetBaseException() is InvalidOperationException); } }