LoginGet() 개인적인 메소드

private LoginGet ( string id, string returnUrl ) : System.Web.Mvc.ActionResult
id string
returnUrl string
리턴 System.Web.Mvc.ActionResult
예제 #1
0
        public void LoginGet_Does_Not_Alter_ViewName_If_It_Starts_With_Tilde()
        {
            // Arrange
            var controller = new IdentityController();
            controller.IdentitySources.AddMock(UnusedMockIdentitySource);

            var mockSource = controller.IdentitySources.AddMock(SelectedMockIdentitySource);

            mockSource.Setup(s => s.Login(It.IsAny<ControllerContext>(), TestReturnUrl))
                      .Returns(new ViewResult { ViewName = TestExplicitViewName });

            // Act
            ActionResult actualResult = controller.LoginGet(SelectedMockIdentitySource, TestReturnUrl.ToString());

            // Assert
            ResultAssert.IsView(actualResult, TestExplicitViewName, ExpectedMasterName);
        }
예제 #2
0
        public void LoginGet_Returns_Result_Of_IdentitySource_Login()
        {
            // Arrange
            var controller = new IdentityController();
            controller.IdentitySources.AddMock(UnusedMockIdentitySource);

            var mockSource = controller.IdentitySources.AddMock(SelectedMockIdentitySource);

            EmptyResult expectedResult = new EmptyResult();
            mockSource.Setup(s => s.Login(It.IsAny<ControllerContext>(), TestReturnUrl))
                      .Returns(expectedResult);

            // Act
            ActionResult actualResult = controller.LoginGet(SelectedMockIdentitySource, TestReturnUrl.ToString());

            // Assert
            Assert.AreSame(expectedResult, actualResult, "Expected that the result of Login would be passed unmodified");
        }
예제 #3
0
        public void LoginGet_Calls_Login_With_ControllerContext_And_ReturnUrl_If_IdentitySource_Found()
        {
            // Arrange
            var controller = new IdentityController();
            controller.IdentitySources.AddMock(UnusedMockIdentitySource);

            var mockSource = controller.IdentitySources.AddMock(SelectedMockIdentitySource);

            // Act
            controller.LoginGet(SelectedMockIdentitySource, TestReturnUrl.ToString());

            // Assert
            mockSource.Verify(s => s.Login(controller.ControllerContext, TestReturnUrl));
        }