UpdateVolunteerContext() public method

public UpdateVolunteerContext ( sp_Volunteer_DM _cVolunteer ) : void
_cVolunteer VolTeer.DomainModels.VT.Vol.sp_Volunteer_DM
return void
Beispiel #1
0
        public void hUpdateVolunteer(sp_Volunteer_DM VOL, string strFirstName, string strMiddleName, string strLastName)
        {
            sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL();

            VOL.VolFirstName = strFirstName;
            VOL.VolMiddleName = strMiddleName;
            VOL.VolLastName = strLastName;

            VOlBll.UpdateVolunteerContext(VOL);
        }
Beispiel #2
0
        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);
        }