public void ApplyMap_WithNoMapping_ReturnsPathUnchanged()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/");

            // Act
            string result = mapping.ApplyMap("/controller1/action1");

            // Assert
            Assert.Equal("/controller1/action1", result);
        }
        public void IsMapped_WithNoMapping_ReturnsFalse()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/");

            // Act
            bool result = mapping.IsMapped("/controller1/action1");

            // Assert
            Assert.Equal(false, result);
        }
        public void ApplyMap_WithMapping_ReturnsMappedPath()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/");
            mapping.Add("/controller1/action1", "/controller2/action2");

            // Act
            string result = mapping.ApplyMap("/controller1/action1");

            // Assert
            Assert.Equal("/controller2/action2", result);
        }
        public void IsMapped_WithMappingAndApplicationVirtualPath_ReturnsTrue()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/weee");
            mapping.Add("/controller1/action1", "/controller2/action2");

            // Act
            bool result = mapping.IsMapped("/weee/controller1/action1");

            // Assert
            Assert.Equal(true, result);
        }
        // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
        public void ConfigureAuth(IAppBuilder app, IAppConfiguration config)
        {
            ReturnUrlMapping returnUrlMapping = new ReturnUrlMapping();
            returnUrlMapping.Add("/account/sign-out", null);
            returnUrlMapping.Add("/admin/account/sign-out", null);

            app.UseCookieAuthentication(new CookieAuthenticationOptions()
            {
                AuthenticationType = Constants.WeeeAuthType,
                LoginPath = new PathString("/account/sign-in"),
                SlidingExpiration = true,
                ExpireTimeSpan = TimeSpan.FromMinutes(60),
                CookieName = EA.Prsd.Core.Web.Constants.CookiePrefix + Constants.WeeeAuthType,
                Provider = new WeeeCookieAuthenticationProvider(returnUrlMapping)
            });
        }