VS2008 can test private and protected methods inherited from base classes, even abstract ones.
If you are happy testing this way then right click on the code to be tested and create unit tests.
Here's an example of a piece of code which I am using to test a private, inherited function, from an abstract class:
[TestMethod()]
[DeploymentItem("PA Manager.dll")]
public void GetNextScheduledTimeTest4()
{
TimeWheel timeWheel = new TimeWheel(1000, null);
AnnouncementSchedule schedule = new AnnouncementSchedule();
schedule.StartDate = DateTime.UtcNow.Date - TimeSpan.FromDays(1);
schedule.StartTime = DateTime.Parse("09:00:00");
schedule.EndDate = DateTime.UtcNow.Date;
schedule.EndTime = DateTime.Parse("14:30:00");
schedule.Interval = DateTime.MinValue + TimeSpan.Parse("01:00:00");
schedule.DaysValid.ValidDay = new Day[7];
schedule.DaysValid.ValidDay[0] = Day.Monday;
schedule.DaysValid.ValidDay[1] = Day.Tuesday;
schedule.DaysValid.ValidDay[2] = Day.Wednesday;
schedule.DaysValid.ValidDay[3] = Day.Thursday;
schedule.DaysValid.ValidDay[4] = Day.Friday;
schedule.DaysValid.ValidDay[5] = Day.Saturday;
schedule.DaysValid.ValidDay[6] = Day.Sunday;
//// test for the next interval time NOT being valid, but the time period and day for the schedule is.
PaAnnouncementSchedule paAnnouncementSchedule = new PaAnnouncementSchedule(timeWheel, schedule);
PrivateObject param0 = new PrivateObject(paAnnouncementSchedule);
PaAnnouncementSchedule_Accessor target = new PaAnnouncementSchedule_Accessor(param0);
DateTime currentTime = DateTime.Parse("14:07:00");
DateTime actual;
DateTime expected = DateTime.MaxValue;
actual = target.GetNextScheduledTime(currentTime);
Assert.AreEqual(expected, actual, "Expected time to be DateTime.MaxValue");
}
Out of that lot the important part is:
PaAnnouncementSchedule paAnnouncementSchedule = new PaAnnouncementSchedule(timeWheel, schedule);
PrivateObject param0 = new PrivateObject(paAnnouncementSchedule);
PaAnnouncementSchedule_Accessor target = new PaAnnouncementSchedule_Accessor(param0);
This allows me to access the private inherited function "GetScheduledTime"