Initialize() public method

Adds a telemetry property for the version of SDK.
public Initialize ( TelemetryContext context ) : System.Threading.Tasks.Task
context TelemetryContext
return System.Threading.Tasks.Task
Esempio n. 1
0
        public async Task InitializeSetsSdkVersionPropertyOfGivenTelemetry()
        {
            ServiceLocator.AddService <IPlatformService>(new PlatformService());
            var initializer      = new SdkVersionPropertyContextInitializer();
            var telemetryContext = new TelemetryContext();
            await initializer.Initialize(telemetryContext);

            Assert.NotNull(telemetryContext.Internal.SdkVersion);
        }
        public async Task InitializeSetsSdkVersionPropertyOfGivenTelemetry()
        {
            ServiceLocator.AddService<IPlatformService>(new PlatformService());
            var initializer = new SdkVersionPropertyContextInitializer();
            var telemetryContext = new TelemetryContext();
            await initializer.Initialize(telemetryContext);

            Assert.NotNull(telemetryContext.Internal.SdkVersion);
        }
 public async Task InitializeSetsSdkVersionValueAsAssemblyVersion()
 {
     ServiceLocator.AddService<IPlatformService>(new PlatformService());
     var initializer = new SdkVersionPropertyContextInitializer();
     var telemetryContext = new TelemetryContext();
     await initializer.Initialize(telemetryContext);
     
     string expectedSdkVersion;
     expectedSdkVersion = typeof(SdkVersionPropertyContextInitializer).GetTypeInfo().Assembly.GetCustomAttributes<AssemblyFileVersionAttribute>()
             .First()
             .Version;
     Assert.Equal("hockeysdk.uwp:" + expectedSdkVersion, telemetryContext.Internal.SdkVersion);
 }
Esempio n. 4
0
        public async Task InitializeSetsSdkVersionValueAsAssemblyVersion()
        {
            ServiceLocator.AddService <IPlatformService>(new PlatformService());
            var initializer      = new SdkVersionPropertyContextInitializer();
            var telemetryContext = new TelemetryContext();
            await initializer.Initialize(telemetryContext);

            string expectedSdkVersion;

            expectedSdkVersion = typeof(SdkVersionPropertyContextInitializer).GetTypeInfo().Assembly.GetCustomAttributes <AssemblyFileVersionAttribute>()
                                 .First()
                                 .Version;
            Assert.Equal("hockeysdk.uwp:" + expectedSdkVersion, telemetryContext.Internal.SdkVersion);
        }