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)); }
/// <summary> /// Sets the upper memory boundary of the beacon cache. /// /// When this is set to a positive value the memory based eviction strategy starts to clear /// data from the beacon cache when the cache size exceeds this setting. /// /// </summary> /// <param name="upperMemoryBoundary">The upper boundary of the beacon cache or negative if unlimited.</param> /// <returns><code>this</code></returns> public AppMonOpenKitBuilderVB WithBeaconCacheUpperMemoryBoundary(long upperMemoryBoundary) { wrappedBuilder.WithBeaconCacheUpperMemoryBoundary(upperMemoryBoundary); return(this); }