public virtual void TestGetServerPrincipal() { string service = "TestKerberosUtil"; string localHostname = KerberosUtil.GetLocalHostName(); string testHost = "FooBar"; // send null hostname Assert.Equal("When no hostname is sent", service + "/" + localHostname .ToLower(Extensions.GetEnglishCulture()), KerberosUtil.GetServicePrincipal (service, null)); // send empty hostname Assert.Equal("When empty hostname is sent", service + "/" + localHostname .ToLower(Extensions.GetEnglishCulture()), KerberosUtil.GetServicePrincipal (service, string.Empty)); // send 0.0.0.0 hostname Assert.Equal("When 0.0.0.0 hostname is sent", service + "/" + localHostname.ToLower(Extensions.GetEnglishCulture()), KerberosUtil.GetServicePrincipal (service, "0.0.0.0")); // send uppercase hostname Assert.Equal("When uppercase hostname is sent", service + "/" + testHost.ToLower(Extensions.GetEnglishCulture()), KerberosUtil.GetServicePrincipal (service, testHost)); // send lowercase hostname Assert.Equal("When lowercase hostname is sent", service + "/" + testHost.ToLower(Extensions.GetEnglishCulture()), KerberosUtil.GetServicePrincipal (service, testHost.ToLower(Extensions.GetEnglishCulture()))); }