public void ApplicationNameGivesPreviouslySetApplicationName() { // given var target = new DynatraceOpenKitBuilder(EndpointUrl, ApplicationId, DeviceId); // when target.WithApplicationName(ApplicationName); var obtained = target.ApplicationName; // then Assert.That(obtained, Is.EqualTo(ApplicationName)); }
public void CanOverrideTrustManagerForDynatrace() { // given var trustManager = Substitute.For <ISSLTrustManager>(); // when var target = new DynatraceOpenKitBuilder(Endpoint, AppID, DeviceID) .WithTrustManager(trustManager) .BuildConfiguration(); // then Assert.That(target.HTTPClientConfig.SSLTrustManager, Is.SameAs(trustManager)); }
public void WithApplicationNameAllowsOverwritingWithNull() { // given var target = new DynatraceOpenKitBuilder(EndpointUrl, ApplicationId, DeviceId); target.WithApplicationName(ApplicationName); // initialize with non-null value // when target.WithApplicationName(null); // then Assert.That(target.ApplicationName, Is.Null); }
public void DefaultsAreSetForDynatrace() { // when var obtained = new DynatraceOpenKitBuilder(Endpoint, AppID, DeviceID).BuildConfiguration(); // then Assert.That(obtained.EndpointURL, Is.EqualTo(Endpoint)); Assert.That(obtained.DeviceID, Is.EqualTo("1234")); Assert.That(obtained.ApplicationName, Is.EqualTo(string.Empty)); Assert.That(obtained.ApplicationID, Is.EqualTo(AppID)); // ensure remaining defaults VerifyDefaultsAreSet(obtained); }
public void CanSetCrashReportingLevelForDynatrace() { // given var target = new DynatraceOpenKitBuilder(Endpoint, AppID, DeviceID); // when var level = CrashReportingLevel.OPT_IN_CRASHES; var obtained = target.WithCrashReportingLevel(level); var config = target.BuildConfiguration().BeaconConfig; // then Assert.That(obtained, Is.InstanceOf <DynatraceOpenKitBuilder>()); Assert.That((DynatraceOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.CrashReportingLevel, Is.EqualTo(level)); }
public void CanSetDataCollectionLevelForDynatrace() { // given var target = new DynatraceOpenKitBuilder(Endpoint, AppID, DeviceID); // when var level = DataCollectionLevel.USER_BEHAVIOR; var obtained = target.WithDataCollectionLevel(level); var config = target.BuildConfiguration().BeaconConfig; // then Assert.That(obtained, Is.InstanceOf <DynatraceOpenKitBuilder>()); Assert.That((DynatraceOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.DataCollectionLevel, Is.EqualTo(level)); }
public void CanSetBeaconCacheUpperMemoryBoundaryForDynatrace() { // given var target = new DynatraceOpenKitBuilder(Endpoint, AppID, DeviceID); const long upperMemoryBoundary = 42L * 1024L; // when var obtained = target.WithBeaconCacheUpperMemoryBoundary(upperMemoryBoundary); var config = target.BuildConfiguration().BeaconCacheConfig; // then Assert.That(obtained, Is.InstanceOf <DynatraceOpenKitBuilder>()); Assert.That((DynatraceOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.CacheSizeUpperBound, Is.EqualTo(upperMemoryBoundary)); }
public void CanSetCustomMaxBeaconRecordAgeForDynatrace() { // given DynatraceOpenKitBuilder target = new DynatraceOpenKitBuilder(Endpoint, AppID, DeviceID); const long maxRecordAge = 123456L; // when var obtained = target.WithBeaconCacheMaxRecordAge(maxRecordAge); var config = target.BuildConfiguration().BeaconCacheConfig; // then Assert.That(obtained, Is.InstanceOf <DynatraceOpenKitBuilder>()); Assert.That((DynatraceOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.MaxRecordAge, Is.EqualTo(maxRecordAge)); }
/// <summary> /// Creates a new instance of type DynatraceOpenKitBuilderVB /// </summary> /// <param name="endPointUrl">endpoint OpenKit connects to</param> /// <param name="applicationId">unique application id</param> /// <param name="deviceId">unique device id</param> public DynatraceOpenKitBuilderVB(string endPointUrl, string applicationId, long deviceId) { wrappedBuilder = new DynatraceOpenKitBuilder(endPointUrl, applicationId, deviceId); }