public AccountsTests()
        {
            service       = Substitute.For <IAccountService>();
            account       = ObjectsFactory.CreateAccountView(0);
            validator     = Substitute.For <IAccountValidator>();
            accountEdit   = ObjectsFactory.CreateAccountEditView(0);
            accountCreate = ObjectsFactory.CreateAccountCreateView(0);
            controller    = Substitute.ForPartsOf <Accounts>(validator, service);

            controller.ControllerContext.HttpContext = new DefaultHttpContext();
            controller.Authorization.Returns(Substitute.For <IAuthorization>());
            controller.ControllerContext.RouteData = new RouteData();
        }
Esempio n. 2
0
        public AccountsControllerTests()
        {
            validator = Substitute.For <IAccountValidator>();
            service   = Substitute.For <IAccountService>();

            accountCreate = ObjectsFactory.CreateAccountCreateView();
            accountEdit   = ObjectsFactory.CreateAccountEditView();
            account       = ObjectsFactory.CreateAccountView();

            controller = Substitute.ForPartsOf <AccountsController>(validator, service);
            controller.ControllerContext.HttpContext = Substitute.For <HttpContext>();
            controller.TempData = Substitute.For <ITempDataDictionary>();
            controller.ControllerContext.RouteData = new RouteData();
            controller.Url = Substitute.For <IUrlHelper>();
        }