public void MapStatusItemTestCurrentToLastWeek() { var target = new DefaultRollStatusProcessor(); var sourceStatusItem = new StatusItem { Caption = "Test", Milestone = new Milestone() { ConfidenceLevel = MilestoneConfidenceLevels.High, Date = new DateTime(2011,1,1), Type = MilestoneTypes.Milestone }, Notes = new List<Note>(), Topic = new Topic() { Caption = "Test Topic" } }; var statusReportDate = new DateTime(2011, 1, 3); var actual = target.MapStatusItem(sourceStatusItem, statusReportDate); Assert.AreEqual(sourceStatusItem.Caption, actual.Caption); Assert.AreEqual(sourceStatusItem.Notes.Count, actual.Notes.Count); Assert.AreEqual(sourceStatusItem.Topic.Caption, actual.Topic.Caption); Assert.AreEqual(MilestoneTypes.LastWeek, actual.Milestone.Type); Assert.AreEqual(sourceStatusItem.Milestone.ConfidenceLevel, actual.Milestone.ConfidenceLevel); Assert.AreEqual(sourceStatusItem.Milestone.Date, actual.Milestone.Date); }
public void MapStatusItemTestElse() { var target = new DefaultRollStatusProcessor(); var sourceStatusItem = new StatusItem { Caption = "Test", Milestone = new Milestone() { ConfidenceLevel = MilestoneConfidenceLevels.High, Date = new DateTime(2011, 1, 1), Type = MilestoneTypes.LastWeek }, Notes = new List<Note>(), Topic = new Topic() { Caption = "Test Topic" } }; var statusReportDate = sourceStatusItem.Milestone.Date.Value.AddDays(1); var actual = target.MapStatusItem(sourceStatusItem, statusReportDate); Assert.AreEqual(sourceStatusItem.Milestone.Type, actual.Milestone.Type); }