Get() public méthode

public Get ( string domainName, bool isHttps, bool includeScheme ) : string
domainName string
isHttps bool
includeScheme bool
Résultat string
Exemple #1
0
        public static string GetBaseDomain(HttpContextBase context, bool includeScheme)
        {
            var approved = GetSerializer();
            string domain = context.Request.Url?.DnsSafeHost;
            bool isHttps = context.Request.IsSecureConnection;

            var locator = new BaseDomainLocator(approved);
            return locator.Get(domain, isHttps, includeScheme);
        }
        public void ShouldLocateDomainWithoutSchemeTest()
        {
            var domains = new FakeDomainSerializer();
            var locator = new BaseDomainLocator(domains);
            string domain = "www.example.com";

            string expected = "example.com";
            string result = locator.Get(domain, false, false);

            Assert.Equal(expected, result);
        }