public void ApplicationNameIsSetCorrectlyForAppMon() { var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID).BuildConfiguration(); Assert.That(target.ApplicationName, Is.EqualTo(AppName)); Assert.That(target.ApplicationName, Is.EqualTo(target.ApplicationID)); }
public void ConstructorInitializesApplicationName() { // given, when var target = new AppMonOpenKitBuilder(EndpointUrl, ApplicationName, DeviceId); // then Assert.That(target.ApplicationName, Is.EqualTo(ApplicationName)); }
public void AppMonOpenKitBuilderTakesStringDeviceID() { // given var target = new AppMonOpenKitBuilder(Endpoint, AppName, "stringDeviceID"); // when, then Assert.That(target.BuildConfiguration().DeviceID, Is.EqualTo("stringDeviceID")); }
public void DefaultServerIdGivesAppropriateValue() { // given, when var target = new AppMonOpenKitBuilder(EndpointUrl, ApplicationName, DeviceId); // then Assert.That(target.DefaultServerId, Is.EqualTo(AppMonOpenKitBuilder.DefaultServerIdValue)); }
public void OpenKitTypeGivesAppropriateValue() { // given, when var target = new AppMonOpenKitBuilder(EndpointUrl, ApplicationName, DeviceId); // then Assert.That(target.OpenKitType, Is.EqualTo(AppMonOpenKitBuilder.Type)); }
public void ApplicationIdGivesSameValueAsApplicationName() { // given, when var target = new AppMonOpenKitBuilder(EndpointUrl, ApplicationName, DeviceId); // then Assert.That(target.ApplicationId, Is.EqualTo(ApplicationName)); }
public void ConstructorInitializesDeviceIdString() { // given, when var target = new AppMonOpenKitBuilder(EndpointUrl, ApplicationName, DeviceId.ToString()); // then Assert.That(target.DeviceId, Is.EqualTo(DeviceId)); Assert.That(target.OrigDeviceId, Is.EqualTo(DeviceId.ToString())); }
public void CanSetManufacturerForAppMon() { // when var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID) .WithManufacturer(Manufacturer) .BuildConfiguration(); // then Assert.That(target.Device.Manufacturer, Is.EqualTo(Manufacturer)); }
public void CannotSetNullTrustManagerForAppMon() { // when var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID) .WithTrustManager(null) .BuildConfiguration(); // then Assert.That(target.HTTPClientConfig.SSLTrustManager, Is.InstanceOf <SSLStrictTrustManager>()); }
public void CanSetModelIDForAppMon() { // when var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID) .WithModelID(ModelID) .BuildConfiguration(); // then Assert.That(target.Device.ModelID, Is.EqualTo(ModelID)); }
public void CanSetOperatingSystemForAppMon() { // when var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID) .WithOperatingSystem(OS) .BuildConfiguration(); // then Assert.That(target.Device.OperatingSystem, Is.EqualTo(OS)); }
public void CanSetApplicationVersionForAppMon() { // when var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID) .WithApplicationVersion(AppVersion) .BuildConfiguration(); // then Assert.That(target.ApplicationVersion, Is.EqualTo(AppVersion)); }
public void CanOverrideTrustManagerForAppMon() { // given var trustManager = Substitute.For <ISSLTrustManager>(); // when var target = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID) .WithTrustManager(trustManager) .BuildConfiguration(); // then Assert.That(target.HTTPClientConfig.SSLTrustManager, Is.SameAs(trustManager)); }
public void DefaultsAreSetForAppMon() { // when var obtained = new AppMonOpenKitBuilder(Endpoint, AppName, DeviceID).BuildConfiguration(); // then Assert.That(obtained.EndpointURL, Is.EqualTo(Endpoint)); Assert.That(obtained.DeviceID, Is.EqualTo("1234")); Assert.That(obtained.ApplicationName, Is.EqualTo(AppName)); Assert.That(obtained.ApplicationID, Is.EqualTo(AppName)); // ensure remaining defaults VerifyDefaultsAreSet(obtained); }
public void CanSetCrashReportingLevelForAppMon() { // given var target = new AppMonOpenKitBuilder(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 <AppMonOpenKitBuilder>()); Assert.That((AppMonOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.CrashReportingLevel, Is.EqualTo(level)); }
public void CanSetDataCollectionLevelForAppMon() { // given var target = new AppMonOpenKitBuilder(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 <AppMonOpenKitBuilder>()); Assert.That((AppMonOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.DataCollectionLevel, Is.EqualTo(level)); }
public void CanSetBeaconCacheUpperMemoryBoundaryForAppMon() { // given var target = new AppMonOpenKitBuilder(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 <AppMonOpenKitBuilder>()); Assert.That((AppMonOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.CacheSizeUpperBound, Is.EqualTo(upperMemoryBoundary)); }
public void CanSetCustomMaxBeaconRecordAgeForAppMon() { // given var target = new AppMonOpenKitBuilder(Endpoint, AppID, DeviceID); const long maxRecordAge = 123456L; // when var obtained = target.WithBeaconCacheMaxRecordAge(maxRecordAge); var config = target.BuildConfiguration().BeaconCacheConfig; // then Assert.That(obtained, Is.InstanceOf <AppMonOpenKitBuilder>()); Assert.That((AppMonOpenKitBuilder)obtained, Is.SameAs(target)); Assert.That(config.MaxRecordAge, Is.EqualTo(maxRecordAge)); }
/// <summary> /// Creates a new instance of type AppMonOpenKitBuilder /// </summary> /// <param name="endpointUrl">endpoint OpenKit connects to</param> /// <param name="applicationName">unique application id</param> /// <param name="deviceId">unique device id</param> public AppMonOpenKitBuilderVB(string endpointUrl, string applicationName, long deviceId) { wrappedBuilder = new AppMonOpenKitBuilder(endpointUrl, applicationName, deviceId); }