Exemplo n.º 1
0
        public void TearDown()
        {
            Database.SetInitializer(new FastDbInitializer(0));

            try
            {
                var _context = new CalendarContext();
                _context.Database.Initialize(true);
            }
            catch { /* Do nothing */ }
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            Database.SetInitializer(new FastDbInitializer(1000));

            try
            {
                var _context = new CalendarContext();
                _context.Database.Initialize(true);
            }
            catch { /* Do nothing */ }

            DiMvc.Register();
            Ioc.RegisterType<IUserRepository, UserRepository>();

            var mock = new Mock<ControllerContext>();
            mock.Setup(p => p.HttpContext.Session).Returns(new Mock<HttpSessionStateBase>().Object);

            _usersController = Ioc.Resolve<UsersController>();
            _usersController.ControllerContext = mock.Object;
        }