Ejemplo n.º 1
0
        public void When_LogOff_Then_SessionAbandoned()
        {
            // Arrange
            _formsAuth.Expect(a => a.SignOut());
            HttpSession.Expect(h => h.Abandon());

            // Act
            var result = _sut.LogOff();

            // Assert
            AssertRedirectToActionReturned(result, "LogOn", "Account");
        }
        public void When_LogOff_Then_SessionAbandoned()
        {
            // Arrange
            _formsAuth.Expect(a => a.SignOut());
            HttpSession.Expect(h => h.Abandon());
            UserIdentity.Expect(a => a.RemoveAntiForgeryCookie(Arg <Controller> .Is.Anything));

            // Act
            var result = _sut.LogOff();

            // Assert
            AssertRedirectToActionReturned(result, "LogOn", "Account");
        }