public Initialize ( ITelemetry telemetry ) : void | ||
telemetry | ITelemetry | |
Результат | void |
public void ReadingDeviceUniqueIdYieldsCorrectValue() { DeviceTelemetryInitializer source = new DeviceTelemetryInitializer(); var requestTelemetry = new RequestTelemetry(); Assert.Null(requestTelemetry.Context.Device.Id); source.Initialize(requestTelemetry); string id = requestTelemetry.Context.Device.Id; string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; string hostName = Dns.GetHostName(); if (hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase) == false) { hostName = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", hostName, domainName); } Assert.Equal(hostName, id); }
public void ReadingDeviceUniqueIdYieldsCorrectValue() { DeviceTelemetryInitializer source = new DeviceTelemetryInitializer(); var requestTelemetry = new RequestTelemetry(); Assert.Null(requestTelemetry.Context.Device.Id); source.Initialize(requestTelemetry); string id = requestTelemetry.Context.Device.Id; string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; string hostName = Dns.GetHostName(); if (hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase) == false) { hostName = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", hostName, domainName); } Assert.Equal(hostName, id); }