Example #1
0
 public SeasonTeamRule(SeasonCompetitionConfig competition, Team team, SeasonDivisionRule division, int?firstYear, int?lastYear)
 {
     Competition = competition;
     Team        = team;
     Division    = division;
     FirstYear   = firstYear;
     LastYear    = lastYear;
 }
Example #2
0
 public SeasonScheduleRule(SeasonCompetitionConfig competition, Team homeTeam, SeasonDivisionRule homeDivisionRule, Team awayTeam, SeasonDivisionRule awayDivisionRule, int iterations, bool homeAndAway, int?firstYear, int?lastYear)
 {
     Competition      = competition;
     HomeTeam         = homeTeam;
     HomeDivisionRule = homeDivisionRule;
     AwayTeam         = awayTeam;
     AwayDivisionRule = awayDivisionRule;
     Iterations       = iterations;
     HomeAndAway      = homeAndAway;
     FirstYear        = firstYear;
     LastYear         = lastYear;
 }
Example #3
0
        public void ShouldGetTeamsInDivisionTopLevel()
        {
            var league = new SeasonDivisionRule()
            {
                Level = DivisionLevel.League, Name = "League"
            };

            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 1", Id = 12345, Skill = 1
                }
            });
            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 2", Id = 12345, Skill = 1
                }
            });
            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 3", Id = 12345, Skill = 1
                }
            });
            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 4", Id = 12345, Skill = 1
                }
            });
            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 5", Id = 12345, Skill = 1
                }
            });
            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 6", Id = 12345, Skill = 1
                }
            });

            Assert.StrictEqual(6, league.Teams.Count);
        }
Example #4
0
        public static void AddDivisionRule(string parent, IList <SeasonDivisionRule> fullDivisionList, DivisionLevel level, params string[] divisionNames)
        {
            for (int i = 0; i < divisionNames.Length; i++)
            {
                var parentDivRule = fullDivisionList.Where(d => d.Name.Equals(parent)).FirstOrDefault();
                var divisionRule  = new SeasonDivisionRule(level, divisionNames[i], parentDivRule);

                if (parentDivRule != null)
                {
                    parentDivRule.AddChildRule(divisionRule);
                }

                fullDivisionList.Add(divisionRule);
            }
        }
Example #5
0
        public static SeasonCompetitionConfig CreateMediumSeasonConfig(League league, List <Team> teamList, List <CompetitionConfig> parents, int?startingDay, int order)
        {
            var seasonConfig = new SeasonCompetitionConfig("Regular Season", league, startingDay, order, null, 1, null, null, null, null, null, null);

            seasonConfig.GameRules = new GameRules("Season Rules", true, 1, 3, 120, true);

            seasonConfig.Parents = parents;

            var drNhl = new SeasonDivisionRule(seasonConfig, "NHL", null, 1, 1, null, 1, null);

            seasonConfig.DivisionRules = new List <SeasonDivisionRule>()
            {
                drNhl
            };

            seasonConfig.ScheduleRules = new List <SeasonScheduleRule>()
            {
                new SeasonScheduleRule(seasonConfig, null, drNhl, null, null, 3, false, 1, null),
            };

            var seasonTeamRules = new List <SeasonTeamRule>()
            {
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Ottawa").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Toronto").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Calgary").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Montreal").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Edmonton").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Vancouver").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Winnipeg").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Quebec").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Hamilton").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Halifax").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Victoria").First(), drNhl, 1, null),
            };

            drNhl.Teams = seasonConfig.GetTeamsInDivision("NHL").ToList();

            seasonConfig.TeamRules = seasonTeamRules;

            league.CompetitionConfigs.Add(seasonConfig);

            return(seasonConfig);
        }
Example #6
0
        public void ShouldAddTeam()
        {
            var league = new SeasonDivisionRule()
            {
                Level = DivisionLevel.League, Name = "League"
            };
            var team = new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 1", Id = 12345, Skill = 1
                }
            };

            league.AddTeam(team);

            Assert.Equal("League", team.Division.Name);
            Assert.StrictEqual(1, league.Teams.Count);
        }
Example #7
0
        public void ShouldAddChildRule()
        {
            var league = new SeasonDivisionRule()
            {
                Level = DivisionLevel.League, Name = "League"
            };
            var westernConference = new SeasonDivisionRule {
                Level = DivisionLevel.Conference, Name = "Western Conference"
            };
            var easternConference = new SeasonDivisionRule {
                Level = DivisionLevel.Conference, Name = "Eastern Conference"
            };

            league.AddChildRule(westernConference);
            league.AddChildRule(easternConference);

            Assert.Equal("League", westernConference.Parent.Name);
            Assert.Equal("League", easternConference.Parent.Name);
            Assert.StrictEqual(2, league.Children.Count);
        }
        private SeasonCompetitionConfig CreateConfig()
        {
            var seasonConfig = new SeasonCompetitionConfig("My Season", null, 1, 1, null, 1, null, null, null, null, null, null);
            var sdrNHL       = new SeasonDivisionRule(seasonConfig, "NHL", null, 1, 1, null, 1, null)
            {
                Id = 1
            };
            var sdrEastern = new SeasonDivisionRule(seasonConfig, "Eastern", sdrNHL, 2, 1, null, 1, null)
            {
                Id = 2
            };
            var sdrWestern = new SeasonDivisionRule(seasonConfig, "Western", sdrNHL, 2, 2, null, 1, null)
            {
                Id = 3
            };
            var sdrEast = new SeasonDivisionRule(seasonConfig, "East", sdrEastern, 2, 1, null, 1, null)
            {
                Id = 4
            };
            var sdrAtlantic = new SeasonDivisionRule(seasonConfig, "Atlantic", sdrEastern, 2, 2, null, 1, null)
            {
                Id = 5
            };
            var sdrNorthEast = new SeasonDivisionRule(seasonConfig, "NorthEast", sdrEastern, 2, 3, null, 1, null)
            {
                Id = 6
            };
            var sdrWest = new SeasonDivisionRule(seasonConfig, "West", sdrWestern, 2, 4, null, 1, null)
            {
                Id = 7
            };
            var sdrCentral = new SeasonDivisionRule(seasonConfig, "Central", sdrWestern, 2, 5, null, 1, null)
            {
                Id = 8
            };
            var sdrCentralA = new SeasonDivisionRule(seasonConfig, "Central A", sdrCentral, 3, 1, null, 1, null)
            {
                Id = 9
            };
            var sdrCentralB = new SeasonDivisionRule(seasonConfig, "Central B", sdrCentral, 3, 2, null, 1, null)
            {
                Id = 10
            };


            var bruins = new Team()
            {
                Name = "Boston", NickName = "Bruins", FirstYear = 1, Active = true, Id = 1
            };                                                                                                      //east
            var canadiens = new Team()
            {
                Name = "Montreal", NickName = "Canadiens", FirstYear = 1, Active = true, Id = 2
            };                                                                                                              //east
            var mapleLeafs = new Team()
            {
                Name = "Toronto", NickName = "Maple Leafs", FirstYear = 1, Active = true, Id = 3
            };                                                                                                                //esat
            var nordiques = new Team()
            {
                Name = "Quebec", NickName = "Nordiques", FirstYear = 1, Active = true, Id = 4
            };                                                                                                            //atlantic
            var penguins = new Team()
            {
                Name = "Pittsburgh", NickName = "Penguins", FirstYear = 1, Active = true, Id = 5
            };                                                                                                              //northeast
            var devils = new Team()
            {
                Name = "New Jersey", NickName = "Devils", FirstYear = 1, Active = true, Id = 6
            };                                                                                                          //northeast
            var sharks = new Team()
            {
                Name = "San Josey", NickName = "Sharks", FirstYear = 1, Active = true, Id = 7
            };                                                                                                         //west
            var oilers = new Team()
            {
                Name = "Edmonton", NickName = "Oilers", FirstYear = 1, Active = true, Id = 8
            };                                                                                                        //west
            var flames = new Team()
            {
                Name = "Calgary", NickName = "Flames", FirstYear = 1, Active = true, Id = 9
            };                                                                                                       //west
            var canucks = new Team()
            {
                Name = "Vancouver", NickName = "Canucks", FirstYear = 1, Active = true, Id = 10
            };                                                                                                            //west
            var jets = new Team()
            {
                Name = "Winnipeg", NickName = "Jets", FirstYear = 1, Active = true, Id = 11
            };                                                                                                    //Central A
            var stars = new Team()
            {
                Name = "Minnesota", NickName = "Stars", FirstYear = 1, Active = true, Id = 12
            };                                                                                                       //Central A
            var blackHawks = new Team()
            {
                Name = "Chicago", NickName = "Blackhawks", FirstYear = 1, Active = true, Id = 13
            };                                                                                                               //Central B
            var redWings = new Team()
            {
                Name = "Detroit", NickName = "Red Wings", FirstYear = 1, Active = true, Id = 14
            };                                                                                                            //Central B


            var seasonTeamRules = new List <SeasonTeamRule>()
            {
                new SeasonTeamRule(seasonConfig, bruins, sdrEast, 1, null)
                {
                    Id = 1
                },
                new SeasonTeamRule(seasonConfig, canadiens, sdrEast, 1, null)
                {
                    Id = 2
                },
                new SeasonTeamRule(seasonConfig, mapleLeafs, sdrEast, 1, null)
                {
                    Id = 3
                },
                new SeasonTeamRule(seasonConfig, nordiques, sdrAtlantic, 1, null)
                {
                    Id = 4
                },
                new SeasonTeamRule(seasonConfig, penguins, sdrNorthEast, 1, null)
                {
                    Id = 5
                },
                new SeasonTeamRule(seasonConfig, devils, sdrNorthEast, 1, null)
                {
                    Id = 6
                },
                new SeasonTeamRule(seasonConfig, sharks, sdrWest, 1, null)
                {
                    Id = 7
                },
                new SeasonTeamRule(seasonConfig, oilers, sdrWest, 1, null)
                {
                    Id = 8
                },
                new SeasonTeamRule(seasonConfig, flames, sdrWest, 1, null)
                {
                    Id = 9
                },
                new SeasonTeamRule(seasonConfig, canucks, sdrWest, 1, null)
                {
                    Id = 10
                },
                new SeasonTeamRule(seasonConfig, jets, sdrCentralA, 1, null)
                {
                    Id = 11
                },
                new SeasonTeamRule(seasonConfig, stars, sdrCentralA, 1, null)
                {
                    Id = 12
                },
                new SeasonTeamRule(seasonConfig, blackHawks, sdrCentralB, 1, null)
                {
                    Id = 13
                },
                new SeasonTeamRule(seasonConfig, redWings, sdrCentralB, 1, null)
                {
                    Id = 14
                }
            };

            var scheduleRules = new List <SeasonScheduleRule>()
            {
                new SeasonScheduleRule(seasonConfig, null, sdrNHL, null, null, 1, true, 1, null)
                {
                    Id = 1
                }
            };

            var divisionRules = new List <SeasonDivisionRule>()
            {
                sdrNHL,
                sdrEastern,
                sdrWestern,
                sdrEast,
                sdrAtlantic,
                sdrNorthEast,
                sdrWest,
                sdrCentral,
                sdrCentralA,
                sdrCentralB
            };

            seasonConfig.DivisionRules = divisionRules;
            seasonConfig.TeamRules     = seasonTeamRules;
            seasonConfig.ScheduleRules = scheduleRules;

            sdrEast.Teams      = seasonTeamRules.Where(str => str.Division.DivisionName.Equals("East"));
            sdrAtlantic.Teams  = seasonTeamRules.Where(str => str.Division.DivisionName.Equals("Atlantic"));
            sdrNorthEast.Teams = seasonTeamRules.Where(str => str.Division.DivisionName.Equals("NorthEast"));
            sdrWest.Teams      = seasonTeamRules.Where(str => str.Division.DivisionName.Equals("West"));
            sdrCentralA.Teams  = seasonTeamRules.Where(str => str.Division.DivisionName.Equals("Central A"));
            sdrCentralB.Teams  = seasonTeamRules.Where(str => str.Division.DivisionName.Equals("Central B"));

            return(seasonConfig);
        }
Example #9
0
        public static SeasonCompetitionConfig CreateLargeSeasonConfiguration(League league, List <Team> teamList, List <CompetitionConfig> parents, int?startingDay, int order)
        {
            var seasonConfig = new SeasonCompetitionConfig("Regular Season", league, startingDay, order, null, 1, null, null, null, null, null, null);

            seasonConfig.GameRules = new GameRules("Season Rules", true, 1, 3, 120, true);

            seasonConfig.Parents = parents;

            var drNhl      = new SeasonDivisionRule(seasonConfig, "NHL", null, 1, 1, null, 1, null);
            var drWestern  = new SeasonDivisionRule(seasonConfig, "Western", drNhl, 2, 1, null, 1, null);
            var drEastern  = new SeasonDivisionRule(seasonConfig, "Eastern", drNhl, 2, 1, null, 1, null);
            var drWest     = new SeasonDivisionRule(seasonConfig, "West", drWestern, 3, 1, null, 1, null);
            var drEast     = new SeasonDivisionRule(seasonConfig, "East", drEastern, 3, 2, null, 1, null);
            var drCentral  = new SeasonDivisionRule(seasonConfig, "Central", drWestern, 3, 3, null, 1, null);
            var drAtlantic = new SeasonDivisionRule(seasonConfig, "Atlantic", drEastern, 3, 4, null, 1, null);
            var drPacific  = new SeasonDivisionRule(seasonConfig, "Pacific", drWestern, 3, 5, null, 1, null);
            var drSouth    = new SeasonDivisionRule(seasonConfig, "South", drEastern, 3, 6, null, 1, null);


            seasonConfig.DivisionRules = new List <SeasonDivisionRule>()
            {
                drNhl, drWestern, drEastern, drWest, drEast, drCentral, drAtlantic, drPacific, drSouth
            };

            seasonConfig.ScheduleRules = new List <SeasonScheduleRule>()
            {
                new SeasonScheduleRule(seasonConfig, null, drNhl, null, null, 1, false, 1, null),
            };

            var seasonTeamRules = new List <SeasonTeamRule>()
            {
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Ottawa").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Toronto").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Buffalo").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Penguins").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Flyers").First(), drEast, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Montreal").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Quebec").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "New Jersey").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Rangers").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Islanders").First(), drAtlantic, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Detroit").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Nashville").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Winnipeg").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Minnesota").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Chicago").First(), drCentral, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Colorado").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Calgary").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Edmonton").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Las Vegas").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Saskatoon").First(), drWest, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Vancouver").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Victoria").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Seattle").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "San Jose").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Los Angelas").First(), drPacific, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Anaheim").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Tampa Bay").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Washington").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Florida").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Atlanta").First(), drSouth, 1, null)
            };

            drEast.Teams     = seasonConfig.GetTeamsInDivision("East").ToList();
            drAtlantic.Teams = seasonConfig.GetTeamsInDivision("Atlantic").ToList();
            drCentral.Teams  = seasonConfig.GetTeamsInDivision("Central").ToList();
            drWest.Teams     = seasonConfig.GetTeamsInDivision("West").ToList();
            drPacific.Teams  = seasonConfig.GetTeamsInDivision("Pacific").ToList();
            drSouth.Teams    = seasonConfig.GetTeamsInDivision("South").ToList();

            seasonConfig.TeamRules = seasonTeamRules;

            league.CompetitionConfigs.Add(seasonConfig);

            return(seasonConfig);
        }
Example #10
0
        public void ShouldGetTeamsDivisionThreeLevels()
        {
            var league = new SeasonDivisionRule()
            {
                Level = DivisionLevel.League, Name = "League"
            };
            var easternConference = new SeasonDivisionRule {
                Level = DivisionLevel.Conference, Name = "Eastern Conference"
            };
            var central = new SeasonDivisionRule {
                Level = DivisionLevel.Division, Name = "Central"
            };

            league.AddChildRule(easternConference);
            easternConference.AddChildRule(central);

            league.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 1", Id = 12345, Skill = 1
                }
            });
            easternConference.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 2", Id = 12345, Skill = 1
                }
            });
            easternConference.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 3", Id = 12345, Skill = 1
                }
            });
            central.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 4", Id = 12345, Skill = 1
                }
            });
            central.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 5", Id = 12345, Skill = 1
                }
            });
            central.AddTeam(new SeasonTeamRule()
            {
                Active = true, Division = null, Parent = new Team()
                {
                    Name = "Team 6", Id = 12345, Skill = 1
                }
            });

            Assert.StrictEqual(3, central.GetTeamsInDivision().Count);
            Assert.StrictEqual(5, easternConference.GetTeamsInDivision().Count);
            Assert.StrictEqual(6, league.GetTeamsInDivision().Count);
        }
Example #11
0
        public void ShouldCreateSeason()
        {
            var seasonRule = new SeasonRule()
            {
                Name = "Season Testing"
            };

            var league = new SeasonDivisionRule()
            {
                Name = "League", Level = DivisionLevel.League
            };
            var conf1 = new SeasonDivisionRule()
            {
                Name = "Conference 1", Level = DivisionLevel.Conference
            };
            var conf2 = new SeasonDivisionRule()
            {
                Name = "Conference 2", Level = DivisionLevel.Conference
            };
            var div1 = new SeasonDivisionRule()
            {
                Name = "Div 1", Level = DivisionLevel.Division
            };
            var div2 = new SeasonDivisionRule()
            {
                Name = "Div 2", Level = DivisionLevel.Division
            };
            var div3 = new SeasonDivisionRule()
            {
                Name = "Div 3", Level = DivisionLevel.Division
            };
            var div4 = new SeasonDivisionRule()
            {
                Name = "Div 4", Level = DivisionLevel.Division
            };

            var oddDivParent = new SeasonDivisionRule()
            {
                Name = "Odd Div", Level = DivisionLevel.Region
            };
            var oddDivChild = new SeasonDivisionRule()
            {
                Name = "Odd Div Child", Level = DivisionLevel.City
            };

            var teamRule1 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 1, Name = "Team 1"
                }, Active = true, Division = div1
            };
            var teamRule2 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 2, Name = "Team 2"
                }, Active = true, Division = div1
            };
            var teamRule3 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 3, Name = "Team 3"
                }, Active = true, Division = div1
            };
            var teamRule4 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 4, Name = "Team 4"
                }, Active = true, Division = div2
            };
            var teamRule5 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 5, Name = "Team 5"
                }, Active = true, Division = div2
            };
            var teamRule6 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 6, Name = "Team 6"
                }, Active = true, Division = div2
            };
            var teamRule7 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 7, Name = "Team 7"
                }, Active = true, Division = div3
            };
            var teamRule8 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 8, Name = "Team 8"
                }, Active = true, Division = div3
            };
            var teamRule9 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 9, Name = "Team 9"
                }, Active = true, Division = div3
            };
            var teamRule10 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 10, Name = "Team 10"
                }, Active = true, Division = div4
            };
            var teamRule11 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 11, Name = "Team 11"
                }, Active = true, Division = div4
            };
            var teamRule12 = new SeasonTeamRule()
            {
                Parent = new Team()
                {
                    Id = 12, Name = "Team 12"
                }, Active = true, Division = div4
            };

            var teamRule13 = new SeasonTeamRule()
            {
                Parent = teamRule6.Parent, Active = true, Division = oddDivChild
            };
            var teamRule14 = new SeasonTeamRule()
            {
                Parent = teamRule12.Parent, Active = true, Division = oddDivChild
            };

            league.AddChildRule(conf1);
            league.AddChildRule(conf2);
            conf1.AddChildRule(div1);
            conf1.AddChildRule(div2);
            conf2.AddChildRule(div3);
            conf2.AddChildRule(div4);
            oddDivParent.AddChildRule(oddDivChild);

            seasonRule.DivisionRules = new List <SeasonDivisionRule>()
            {
                league, conf1, conf2, div1, div2, div3, div4, oddDivParent, oddDivChild
            };
            seasonRule.TeamRules = new List <SeasonTeamRule>()
            {
                teamRule1, teamRule2, teamRule3, teamRule4, teamRule5, teamRule6, teamRule7, teamRule8, teamRule9, teamRule10, teamRule11, teamRule12, teamRule13, teamRule14
            };
            //where will the game creator come from?
            var season = seasonRule.Create(null, 1, 1, 1, new SeasonGameCreator(null, true, 2));

            Assert.StrictEqual(9, season.Divisions.Count);
            Assert.StrictEqual(12, season.Teams.Count);

            Assert.StrictEqual(2, season.Divisions.ToList().Where(d => d.Name.Equals("League")).First().Children.Count);
            Assert.StrictEqual(2, season.Divisions.ToList().Where(d => d.Name.Equals("Conference 1")).First().Children.Count);
            Assert.StrictEqual(2, season.Divisions.ToList().Where(d => d.Name.Equals("Conference 1")).First().Children.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Div 1")).First().Children.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Div 2")).First().Children.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Div 3")).First().Children.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Div 4")).First().Children.Count);
            Assert.StrictEqual(1, season.Divisions.ToList().Where(d => d.Name.Equals("Odd Div")).First().Children.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Odd Div Child")).First().Children.Count);

            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("League")).First()._Teams.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Conference 1")).First()._Teams.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Conference 1")).First()._Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 1")).First()._Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 2")).First()._Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 3")).First()._Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 4")).First()._Teams.Count);
            Assert.StrictEqual(0, season.Divisions.ToList().Where(d => d.Name.Equals("Odd Div")).First()._Teams.Count);
            Assert.StrictEqual(2, season.Divisions.ToList().Where(d => d.Name.Equals("Odd Div Child")).First()._Teams.Count);

            Assert.StrictEqual(12, season.Divisions.ToList().Where(d => d.Name.Equals("League")).First().Teams.Count);
            Assert.StrictEqual(6, season.Divisions.ToList().Where(d => d.Name.Equals("Conference 1")).First().Teams.Count);
            Assert.StrictEqual(6, season.Divisions.ToList().Where(d => d.Name.Equals("Conference 1")).First().Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 1")).First().Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 2")).First().Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 3")).First().Teams.Count);
            Assert.StrictEqual(3, season.Divisions.ToList().Where(d => d.Name.Equals("Div 4")).First().Teams.Count);

            Assert.StrictEqual(2, season.Divisions.ToList().Where(d => d.Name.Equals("Odd Div")).First().Teams.Count);
            Assert.StrictEqual(2, season.Divisions.ToList().Where(d => d.Name.Equals("Odd Div Child")).First().Teams.Count);
        }