public void BeaconCacheConfigurationFromNullReturnsNull()
        {
            // given, when
            var obtained = BeaconCacheConfiguration.From(null);

            // then
            Assert.That(obtained, Is.Null);
        }
        public void PositiveLowerCacheSizeBoundIsTakenOverFromOpenKitBuilder()
        {
            // given
            const long lowerBound = 73;
            var        builder    = Substitute.For <IOpenKitBuilder>();

            builder.BeaconCacheLowerMemoryBoundary.Returns(lowerBound);

            // when
            var obtained = BeaconCacheConfiguration.From(builder);

            // then
            _ = builder.Received(1).BeaconCacheLowerMemoryBoundary;
            Assert.That(obtained.CacheSizeLowerBound, Is.EqualTo(lowerBound));
        }
        public void ZeroMaxOrderAgeIsTakenOverFromOpenKitBuilder()
        {
            // given
            const long maxRecordAge = 0;
            var        builder      = Substitute.For <IOpenKitBuilder>();

            builder.BeaconCacheMaxBeaconAge.Returns(maxRecordAge);

            // when
            var obtained = BeaconCacheConfiguration.From(builder);

            // then
            _ = builder.Received(1).BeaconCacheMaxBeaconAge;
            Assert.That(obtained.MaxRecordAge, Is.EqualTo(maxRecordAge));
        }