public sp_Volunteer_DM hSelectVolunteer(Guid VolID) { sp_Volunteer_DM VOL = new sp_Volunteer_DM(); sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL(); VOL = VOlBll.ListVolunteers(VolID); return VOL; }
public List<sp_Volunteer_DM> hSelectVolunteer() { List<sp_Volunteer_DM> VOLList = null; sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL(); VOLList = VOlBll.ListVolunteers(); return VOLList; }
public void TestGroupVolCreate() { var group_bll = new sp_Group_BLL(); var vol_bll = new sp_Volunteer_BLL(); var groupVol_bll = new sp_GroupVol_BLL(); var groupVol_dm = new sp_Vol_GroupVol_DM(); var allGroups = group_bll.ListGroups(); var allVols = vol_bll.ListVolunteers(); Assert.IsTrue(allGroups.Count > 0, "ListGroups() is broken or no data in DB"); Assert.IsTrue(allVols.Count > 0, "ListVolunteers() is broken or no data in DB"); groupVol_dm.GroupID = allGroups[0].GroupID; groupVol_dm.VolID = allVols[0].VolID; groupVol_dm.Admin = true; groupVol_dm.PrimaryVolID = true; groupVol_bll.InsertGroupContext(ref groupVol_dm); var groupVol_dm_selected = groupVol_bll.ListGroupVols(groupVol_dm); Assert.AreEqual(1, groupVol_dm_selected.Count); Assert.IsTrue(Equals(groupVol_dm, groupVol_dm_selected[0])); }
public void TestVolunteerCreate() { createTestVol = new sp_Volunteer_DM(); string volFirst = "TestFirst"; string volMiddle = "TestMiddle"; string volLast = "TestLast"; bool ActiveFlg = true; sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); sp_Volunteer_DM vol_dm = new sp_Volunteer_DM(); vol_dm.VolFirstName = volFirst; vol_dm.VolMiddleName = volMiddle; vol_dm.VolLastName = volLast; vol_dm.ActiveFlg = ActiveFlg; System.Guid volID = Guid.NewGuid(); vol_dm.VolID = volID; createTestVol = vol_dm; vol_bll.InsertVolunteerContext(ref vol_dm); sp_Volunteer_DM vol_dm_selected = vol_bll.ListVolunteers(volID); Assert.IsTrue(VolEquals(vol_dm, vol_dm_selected)); }
public void TestVolunteerDelete() { sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); vol_bll.DeleteVolunteerContext(secondaryTestVol); sp_Volunteer_DM selectedVol = vol_bll.ListVolunteers(secondaryTestVol.VolID); secondaryTestVol.ActiveFlg = false; Assert.IsNotNull(selectedVol.ActiveFlg); Assert.IsFalse(selectedVol.ActiveFlg == true); Assert.IsTrue(selectedVol.ActiveFlg == false); }
public void TestVolunteerUpdate() { sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); List<sp_Volunteer_DM> allVols = vol_bll.ListVolunteers(); Assert.IsTrue(allVols.Count > 0, "The ListVolunteers() is broken, or no data in DB"); sp_Volunteer_DM firstVol = allVols[0]; firstVol.VolID = Guid.NewGuid(); vol_bll.InsertVolunteerContext(ref firstVol); String newFirst = "NewFirst"; String newMiddle = "NewMiddle"; String newLast = "NewLast"; firstVol.VolFirstName = newFirst; firstVol.VolMiddleName = newMiddle; firstVol.VolLastName = newLast; vol_bll.UpdateVolunteerContext(firstVol); volunteersToRemove.Add(firstVol); sp_Volunteer_DM selectedVol = vol_bll.ListVolunteers(firstVol.VolID); Assert.IsTrue(VolEquals(firstVol, selectedVol)); Assert.AreEqual(newFirst, selectedVol.VolFirstName); Assert.AreEqual(newMiddle, selectedVol.VolMiddleName); Assert.AreEqual(newLast, selectedVol.VolLastName); }
public void TestVolunteerRead() { string helperDir = cExcel.GetHelperFilesDir(); DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(helperDir, "Volunteer.xlsx")); var excelDMs = getVolDMs(dt); var numRows = cExcel.getNumRecordsFromDB("[Vol].[tblVolunteer]"); sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); List<sp_Volunteer_DM> allVols = vol_bll.ListVolunteers(); Assert.AreEqual(numRows, allVols.Count); foreach (sp_Volunteer_DM testVol in excelDMs) { sp_Volunteer_DM selectedVol = vol_bll.ListVolunteers(testVol.VolID); Assert.IsTrue(VolEquals(testVol, selectedVol)); } }