コード例 #1
0
        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>();
        }
コード例 #2
0
        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>();
        }
コード例 #3
0
ファイル: Service.cs プロジェクト: jamieishere/IDSM3
 public bool TryGetUserTeam(out UserTeam ut, int userTeamId)
 {
     return _userTeams.TryGet(out ut, x => x.Id == userTeamId);
 }