Exemplo n.º 1
0
        public void ConstructorSetsPropertiesToDefaultValues()
        {
            // Act
            AccountController controller = new AccountController();

            // Assert
            Assert.IsNotNull(controller.FormsAuth, "FormsAuth property is null.");
            Assert.IsNotNull(controller.MembershipService, "MembershipService property is null.");
        }
Exemplo n.º 2
0
        private static AccountController GetAccountController()
        {
            //to modify
            IFormsAuthentication formsAuth = new MockFormsAuthenticationService();
            MembershipProvider membershipProvider = new MockMembershipProvider();
            IStoresRepository storeService = new StoresRepository();

            AccountMembershipService membershipService = new AccountMembershipService(membershipProvider);

            AccountController controller = new AccountController(formsAuth, membershipService, storeService);
            ControllerContext controllerContext = new ControllerContext(new MockHttpContext(), new RouteData(), controller);
            controller.ControllerContext = controllerContext;
            return controller;
        }
Exemplo n.º 3
0
        public void ConstructorSetsProperties()
        {
            // Arrange
            IFormsAuthentication formsAuth = new MockFormsAuthenticationService();
            IMembershipService membershipService = new AccountMembershipService();
            IStoresRepository storeService  = new StoresRepository();

            // Act
            AccountController controller = new AccountController(formsAuth, membershipService, storeService);

            // Assert
            Assert.AreEqual(formsAuth, controller.FormsAuth, "FormsAuth property did not match.");
            Assert.AreEqual(membershipService, controller.MembershipService, "MembershipService property did not match.");
        }