Ejemplo n.º 1
0
        public override void Given()
        {
            viewModel = new CreateTeamViewModel();
              viewModel.DivisionId = divisionId;

              var season = new Season("temp", GameType.EightBall);
              season.SetIdTo(1);
              var division = new Division("temp", DateTime.Now, season);
              division.SetIdTo(1);

              repository.Setup(r => r.Get<Division>(divisionId)).Returns(division);

              users = DomainModelHelper.GetUsers(5);
              repository.Setup(r => r.SqlQuery<User>(It.IsAny<string>(), division.Season.Id)).Returns(users.AsQueryable());
              repository.Init<User>(users.AsQueryable(), true);

              controller.ModelState.AddModelError("Name", new Exception("test"));
        }
Ejemplo n.º 2
0
        public override void Given()
        {
            viewModel = new CreateTeamViewModel();
              viewModel.Name = name;
              viewModel.DivisionId = divisionId;

              var season = new Season("temp", GameType.EightBall);
              season.SetIdTo(1);
              var division = new Division("temp", DateTime.Now, season);
              division.SetIdTo(divisionId);

              repository.Setup(r => r.Get<Division>(divisionId)).Returns(division);
              repository.Setup(r => r.SaveOrUpdate<Team>(It.IsAny<Team>())).Callback<Team>(t => savedTeam = t).Returns(savedTeam);

              users = DomainModelHelper.GetUsers(5);
              repository.Init<User>(users.AsQueryable(), true);
        }
Ejemplo n.º 3
0
        public override void Given()
        {
            viewModel = new CreateTeamViewModel();
              viewModel.Name = name;
              viewModel.DivisionId = divisionId;

              var season = new Season("temp", GameType.EightBall);
              season.SetIdTo(1);
              var division = new Division("temp", DateTime.Now, season);
              division.SetIdTo(1);
              division.AddTeam(new Team(name, division));
              repository.Setup(r => r.Get<Division>(divisionId)).Returns(division);

              users = DomainModelHelper.GetUsers(5);
              repository.Setup(r => r.SqlQuery<User>(It.IsAny<string>(), season.Id)).Returns(users.AsQueryable());
              repository.Init<User>(users.AsQueryable(), true);
              viewModel.SelectedPlayers = new int[1] { users[0].Id };
        }