コード例 #1
0
ファイル: CoachTest.cs プロジェクト: saviofigueiredo/E-Coach
        public void CoachIsCorrectlySaved()
        {
            var newCoach = new Coach {Email = "*****@*****.**", Name = "Joel Santana"};

            newCoach.Insert();

            var persistedCoach = PersistenceManager.Get().Find(newCoach);
            persistedCoach.ShouldBeEquivalentTo(newCoach);
        }
コード例 #2
0
ファイル: CoachTest.cs プロジェクト: saviofigueiredo/E-Coach
        public void CoachAthetesAreCorrectlySaved()
        {
            var newCoach = new Coach { Email = "*****@*****.**", Name = "Joel Santana" };
            var newAthlete = new Athlete { Name = "Zico", Email = "*****@*****.**" };
            newCoach.AddAthlete(newAthlete);

            newCoach.Insert();

            var persistedCoach = PersistenceManager.Get().Find(newCoach);
            persistedCoach.Athletes.Should().Contain(newAthlete);
        }
コード例 #3
0
        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);
        }