public void AddApiTelemetryFeature(ApiTelemetryFeature feature, bool isTrue)
        {
            string telemetryEnabled = TelemetryConstants.False;

            if (isTrue)
            {
                telemetryEnabled = TelemetryConstants.True;
            }

            _apiTelemetry[MatsConverter.AsString(feature)] = telemetryEnabled;
        }
        public void AddContextCorrectlyAddsFieldsToPropertyBagContents()
        {
            string sessionId    = "00000000-0000-0000-0000-000000000000";
            var    contextStore = ContextStore.CreateContextStore(TelemetryAudienceType.PreProduction, "AppName", "1.0", "deviceId", "deviceNetworkState", sessionId, 1);
            var    propertyBag  = new PropertyBag(EventType.Scenario, null);
            var    propertyList = new List <IPropertyBag> {
                propertyBag
            };

            contextStore.AddContext(propertyList);

            var contentsWithContext = propertyBag.GetContents();

            Assert.AreEqual(MatsConverter.AsString(TelemetryAudienceType.PreProduction), contentsWithContext.StringProperties[ContextPropertyNames.AppAudienceConstStrKey]);
            Assert.AreEqual("AppName", contentsWithContext.StringProperties[ContextPropertyNames.AppNameConstStrKey]);
            Assert.AreEqual("1.0", contentsWithContext.StringProperties[ContextPropertyNames.AppVerConstStrKey]);
            Assert.AreEqual("deviceId", contentsWithContext.StringProperties[ContextPropertyNames.DptiConstStrKey]);
            Assert.AreEqual(sessionId, contentsWithContext.StringProperties[ContextPropertyNames.SessionIdConstStrKey]);
            Assert.AreEqual(1, contentsWithContext.IntProperties[ContextPropertyNames.PlatformConstStrKey]);
        }
Ejemplo n.º 3
0
 public override string GetMatsOsPlatform()
 {
     return(MatsConverter.AsString(OsPlatform.Win32));
 }
 public override string GetMatsOsPlatform()
 {
     // TODO(mats): need to detect operating system and switch on it to determine proper enum
     return(MatsConverter.AsString(OsPlatform.Win32));
 }
 public void AddApiTelemetryFeature(ApiTelemetryFeature feature)
 {
     _apiTelemetry[MatsConverter.AsString(feature)] = TelemetryConstants.True;
 }
Ejemplo n.º 6
0
 public void AddApiTelemetryFeature(ApiTelemetryFeature feature)
 {
     _apiTelemetry[MatsConverter.AsString(feature)] = "true";
 }