public void AddActivity(Activity activity) { if (Activities == null) { Activities = new List<Activity>(); } Activities.Add(activity); }
public void AthleteActivitiesAreCorrectlySaved() { var newCoach = new Coach { Email = "*****@*****.**", Name = "Joel Santana" }; var newAthlete = new Athlete() { Email = "*****@*****.**", Name = "Zico" }; var newActivity = new Activity() { Date = System.DateTime.Now, Description = "Run 5 kms" }; newAthlete.AddActivity(newActivity); newCoach.AddAthlete(newAthlete); newCoach.Insert(); PersistenceManager.Get().Find(newAthlete).GetActivities().FirstOrDefault().ShouldBeEquivalentTo(newActivity); }