public EncounterRepository(DatabaseConnection aContext) { context = aContext; matchConverter = new EncounterMapper(); commentConverter = new CommentMapper(); teamConverter = new TeamMapper(); factory = new EncounterFactory(); }
public EncounterSimpleServices(ILoginServices loginServices, IRepository <Encounter> encounterRepo, IRepository <Sport> sportRepo, IRepository <Team> teamRepo, IRepository <User> userRepo, IRepository <Comment> commentRepo) { this.loginServices = loginServices; encounterRepository = encounterRepo; this.userRepo = userRepo; this.commentRepo = commentRepo; adminValidator = new PermissionValidator(Role.Administrator, loginServices); mapper = new EncounterMapper(sportRepo, teamRepo, commentRepo); }
public FixtureServices(ILoginServices loginServices, IRepository <Encounter> encounterRepository, IRepository <Sport> sportRepo, IRepository <Team> teamRepo, IAssemblyLoader assemblyLoader, IRepository <Comment> commentRepo) { this.adminValidator = new PermissionValidator(Role.Administrator, loginServices); mapper = new EncounterMapper(sportRepo, teamRepo, commentRepo); this.encounterRepository = encounterRepository; this.teamRepo = teamRepo; this.assemblyLoader = assemblyLoader; this.commentRepo = commentRepo; SetupAssemblyLoader(); this.sportRepo = sportRepo; }
public EncounterQueryServices(ILoginServices loginServices, IExtendedEncounterRepository encounterRepository, IRepository <Sport> sportRepo, IRepository <Team> teamRepo, IRepository <User> userRepo, IRepository <Comment> commentRepo) { this.loginServices = loginServices; this.encounterRepository = encounterRepository; this.sportRepo = sportRepo; this.teamRepo = teamRepo; this.userRepo = userRepo; this.commentRepo = commentRepo; encounterMapper = new EncounterMapper(sportRepo, teamRepo, commentRepo); commentMapper = new CommentMapper(userRepo); }
public void TestInit() { userRepo = new UserRepository(GetContextFactory()); sportRepo = new SportRepository(GetContextFactory()); teamRepo = new TeamRepository(GetContextFactory()); encounterRepo = new ExtendedEncounterRepository(GetContextFactory()); commentRepo = new CommentRepository(GetContextFactory()); mapper = new SilverFixture.Services.DTO_Mappers.EncounterMapper(sportRepo, teamRepo, commentRepo); teamMapper = new TeamMapper(sportRepo); userRepo.Add(new User(Role.Administrator, "sSanchez", "Santiago", "Sanchez", "user", "*****@*****.**")); userRepo.Add(new User(Role.Follower, "martinFowler", "Martin", "Fowler", "user", "*****@*****.**")); login = new LoginServices(userRepo, teamRepo); assemblyLoader = new SilverFixture.AssemblyLoader.AssemblyLoader(); InitializeTeams(); }
public void SetUp() { factory = new EncounterFactory(); testMapper = new EncounterMapper(); SportEntity testSport = new SportEntity() { Name = "Soccer", IsTwoTeams = true }; TeamEntity homeTest = new TeamEntity { TeamNumber = 3, SportEntityName = "Soccer", Sport = testSport, Name = "Nacional", Photo = "aPath" }; TeamEntity awayTest = new TeamEntity { TeamNumber = 4, SportEntityName = "Soccer", Sport = testSport, Name = "Torque", Photo = "aPath" }; entity = new EncounterEntity() { Id = 3, Date = DateTime.Now, SportEntity = testSport, HasResult = false, Commentaries = new List <CommentEntity>() }; EncounterTeam homeRel = new EncounterTeam() { Team = homeTest, TeamNumber = 3, Encounter = entity, EncounterId = 3 }; EncounterTeam awayRel = new EncounterTeam() { Team = awayTest, TeamNumber = 4, Encounter = entity, EncounterId = 3 }; playingTeams = new List <EncounterTeam>() { homeRel, awayRel }; homeMock = new Team(3, "Nacional", "aPath", new Sport("Soccer", true)); awayMock = new Team(4, "Torque", "aPath", new Sport("Soccer", true)); Sport sport = new Sport("Soccer", true); match = factory.CreateEncounter(new List <Team>() { homeMock, awayMock }, DateTime.Now, sport); }
public EncounterEntity() { mapper = new EncounterMapper(); Comments = new List <CommentEntity>(); }