コード例 #1
0
        public static PlayingStatus Create(Fixture fixture, Child player)
        {
            var newPlayingStatus = new PlayingStatus
            {
                Fixture = fixture,
                Player = player
            };

            player.PlayingStatuses.Add(newPlayingStatus);
            fixture.PlayingStatuses.Add(newPlayingStatus);

            return newPlayingStatus;
        }
コード例 #2
0
        public void SchoolHasFixtures()
        {
            using (var db = new SchoolDataContext())
            {
                Fixture fixture = new Fixture();
                fixture.Kickoff = DateTime.Now;
                db.Fixtures.Add(fixture);

                School school = new School();
                db.Schools.Add(school);

                school.Fixtures.Add(fixture);
                db.SaveChanges();

                Assert.That(school.Fixtures.Contains<Fixture>(fixture));
            }
        }
コード例 #3
0
        public void ChildHasFixtures()
        {
            using (var db = new SchoolDataContext())
            {
                Fixture fixture = new Fixture();
                fixture.Kickoff = DateTime.Now;
                db.Fixtures.Add(fixture);

                Child child = new Child();
                db.Children.Add(child);

                PlayingStatus playingStatus = PlayingStatus.Create(fixture, child);
                db.PlayingStatuses.Add(playingStatus);

                db.SaveChanges();

                Assert.That(child.PlayingStatuses.Contains<PlayingStatus>(playingStatus));
            }
        }