public TrainingCalendarWeek SetupAWeek() { var aMonday = DateTime.ParseExact("21/03/2016", "dd/MM/yyyy", CultureInfo.InvariantCulture); var aDay = DateTime.ParseExact("22/03/2016", "dd/MM/yyyy", CultureInfo.InvariantCulture); var day = new TrainingCalendarDay(aDay); day.AddActivity(CreateActivity(aDay)); var week = new TrainingCalendarWeek(aMonday, TrainingPhase.BaseOne, 400, TimeSpan.Zero); week.AddDay(day); return week; }
public TrainingCalendarWeek SetupAWeek() { var aMonday = DateTime.ParseExact("21/03/2016", "dd/MM/yyyy", CultureInfo.InvariantCulture); var aDay = DateTime.ParseExact("22/03/2016", "dd/MM/yyyy", CultureInfo.InvariantCulture); var day = new TrainingCalendarDay(aDay); day.AddActivity(CreateActivity(aDay)); var week = new TrainingCalendarWeek(aMonday, TrainingPhase.BaseOne, 400, TimeSpan.Zero); week.AddDay(day); return(week); }
private void TestXmlDersialisation() { var week = SetupAWeek(); var desers = new XmlSerializer(typeof(TrainingCalendarWeek)); var reader = new StreamReader(@"c:\dev\AutoCoach\TestXMLData\TrainingCalendarTests.xml"); var serWeek = desers.Deserialize(reader); Assert.IsType <TrainingCalendarWeek>(serWeek); Assert.NotNull(serWeek); TrainingCalendarWeek testWeek = (TrainingCalendarWeek)serWeek; Assert.Equal(week.WeekHoursTarget, testWeek.WeekHoursTarget); Assert.Equal(week.TotalTrainingTime(), testWeek.TotalTrainingTime()); Assert.Equal(week.FirstDate, testWeek.FirstDate); Assert.Equal(week.Phase, testWeek.Phase); Assert.Equal(week.WeekTssTarget, testWeek.WeekTssTarget); }
private void TestWeek_Starts_On_Monday() { var week = new TrainingCalendarWeek(DateTime.ParseExact("21/03/2016", "dd/MM/yyyy", CultureInfo.InvariantCulture), TrainingPhase.BaseOne, 0, TimeSpan.Zero); }
private void TestWeek_Starts_On_Monday() { var week = new TrainingCalendarWeek(DateTime.ParseExact("21/03/2016", "dd/MM/yyyy", CultureInfo.InvariantCulture), TrainingPhase.BaseOne, 0, TimeSpan.Zero); }