Example #1
0
        public void SetUp()
        {
            DiMvc.Register();
            Ioc.RegisterType<ITeamRepository, TeamRepository>();

            _unit = new RepoUnit();
            _unit.Team.Save(new Team { Name = ".NET", Description = ".NET" });
            _unit.Team.Save(new Team { Name = "PHP", Description = "PHP" });

            _teamService = new TeamService(_unit);
            _teamController = new TeamController(_teamService);
        }
Example #2
0
        public void Setup()
        {
            FakeDi.Register();

            _repoUnit = new RepoUnit();
            Ioc.RegisterInstance<RepoUnit>(_repoUnit);

            _teams = new List<Team>
            {
                new Team {Name = ".NET", Description = ".NET team"},
                new Team {Name = ".PHP", Description = ".PHP team"},
                new Team {Name = ".C++", Description = ".C++ team"}
            };

            _teams.ForEach(_repoUnit.Team.Save);

            _config = Config.Instance as FakeConfig;
            _config.PageSize = _teams.Count;

            _teamService = new TeamService(_repoUnit);
            Ioc.RegisterInstance<TeamService>(_teamService);
        }
Example #3
0
        public void SetUpFixture()
        {
            FakeDi.Register();

            var team = new Team
            {
                Name = ".NET",
                Description = ".NET TEAM"
            };

            var repoUnit = new RepoUnit();
            Ioc.RegisterInstance<RepoUnit>(repoUnit);

            _teamService = new TeamService(repoUnit);
            Ioc.RegisterInstance<TeamService>(_teamService);

            _teamService.CreateTeam(new TeamEditVm(team));

            //Setup Team controller and mock http context
            var dummyRequestContext = new RequestContext(new Mock<HttpContextBase>().Object, new RouteData());

            _teamController = Ioc.Resolve<TeamController>();
            _teamController.Url = new UrlHelper(dummyRequestContext);
        }
Example #4
0
        public void SetUp()
        {
            FakeDi.Register();

            _unit = new RepoUnit();
            Ioc.RegisterInstance<RepoUnit>(_unit);

            _teamService = new TeamService(_unit);
            Ioc.RegisterInstance<TeamService>(_teamService);
        }
Example #5
0
 public TeamController(TeamService service)
 {
     _service = service;
 }