public GameControllerTest() { // autofixture automatically creates objects _fixture = new Fixture(); _fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); _fixture.Behaviors.Add(new OmitOnRecursionBehavior(1)); //Recursion of 1 _creator = _fixture.Create<UserProfile>(); _user = _fixture.Create<UserProfile>(); _game = _fixture.Create<Game>(); _uteams = new HashSet<UserTeam>(); _ut = _fixture.Create<UserTeam>(); _utp = null; _games = _fixture.Create<List<Game>>(); _userteams = _fixture.Create<List<UserTeam>>(); _mockServiceLayer = new Mock<IService>(); }
public ViewPlayersControllerTest() { // autofixture automatically creates objects _fixture = new Fixture(); _fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); _fixture.Behaviors.Add(new OmitOnRecursionBehavior(1)); //Recursion of 1 _creator = _fixture.Create<UserProfile>(); _user = _fixture.Create<UserProfile>(); _game = _fixture.Create<Game>(); _uteams = new HashSet<UserTeam>(); _ut = _fixture.Create<UserTeam>(); _utp = null; _games = _fixture.Create<List<Game>>(); _userteams = _fixture.Create<List<UserTeam>>(); _player = _fixture.Create<Player>(); // Mock the Players Repository using Moq _mockGameRepository = new Mock<IGameRepository>(); _mockUserTeamRepository = new Mock<IUserTeamRepository>(); _mockWSW = new Mock<IWebSecurityWrapper>(); _mockUserRepository = new Mock<IUserRepository>(); _mockPlayerRepository = new Mock<IPlayerRepository>(); }
public bool TryGetUserTeam(out UserTeam ut, int userTeamId) { return _userTeams.TryGet(out ut, x => x.Id == userTeamId); }