Esempio n. 1
0
        public void ApplyMap_WithNoMapping_ReturnsPathUnchanged()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/");

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

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

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

            // Assert
            Assert.Equal(false, result);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        // 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(180),
                CookieName         = EA.Prsd.Core.Web.Constants.CookiePrefix + Constants.WeeeAuthType,
                Provider           = new WeeeCookieAuthenticationProvider(returnUrlMapping)
            });
        }