예제 #1
0
        public void CreatingOpenKitConfigurationFromNonNullBuilderGivesNonNullConfiguration()
        {
            // when
            var obtained = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(obtained, Is.Not.Null);
        }
예제 #2
0
        public void CreatingOpenKitConfigurationFromBuilderCopiesType()
        {
            // given, when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.OpenKitType, Is.EqualTo(OpenKitType));
            _ = mockOpenKitBuilder.Received(1).OpenKitType;
        }
예제 #3
0
        public void CreatingOpenKitConfigurationFromBuilderCopiesDeviceId()
        {
            // given, when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.DeviceId, Is.EqualTo(DeviceId));
            _ = mockOpenKitBuilder.Received(1).DeviceId;
        }
예제 #4
0
        public void CreatingAnOpenKitConfigurationFromBuilderCopiesEndpointUrl()
        {
            // given, when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.EndpointUrl, Is.EqualTo(EndpointUrl));
            _ = mockOpenKitBuilder.Received(1).EndpointUrl;
        }
예제 #5
0
        public void CreatingOpenKitConfigurationFromBuilderCopiesManufacturer()
        {
            // given, when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.Manufacturer, Is.EqualTo(Manufacturer));
            _ = mockOpenKitBuilder.Received(1).Manufacturer;
        }
예제 #6
0
        public void CreatingOpenKitConfigurationFromBuilderCopiesApplicationVersion()
        {
            // given, when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.ApplicationVersion, Is.EqualTo(ApplicationVersion));
            _ = mockOpenKitBuilder.Received(1).ApplicationVersion;
        }
예제 #7
0
        public void CreatingOpenKitConfigurationFromBuilderPercentEncodesApplicationId()
        {
            // given
            mockOpenKitBuilder.ApplicationId.Returns("/App_ID%");
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // when
            var obtained = target.ApplicationIdPercentEncoded;

            // then
            Assert.That(obtained, Is.EqualTo("%2FApp%5FID%25"));
        }
예제 #8
0
        public void CreatingAnOpenKitConfigurationFromBuilderCopiesHttpResponseInterceptor()
        {
            // given
            var responseInterceptor = Substitute.For <IHttpResponseInterceptor>();

            mockOpenKitBuilder.HttpResponseInterceptor.Returns(responseInterceptor);

            // when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.HttpResponseInterceptor, Is.SameAs(responseInterceptor));
            _ = mockOpenKitBuilder.Received(1).HttpResponseInterceptor;
        }
예제 #9
0
        public void CreatingOpenKitConfigurationFromBuilderCopiesTrustManager()
        {
            // given, when
            var trustManager = Substitute.For <ISSLTrustManager>();

            mockOpenKitBuilder.TrustManager.Returns(trustManager);

            // when
            var target = OpenKitConfiguration.From(mockOpenKitBuilder);

            // then
            Assert.That(target.TrustManager, Is.SameAs(trustManager));
            _ = mockOpenKitBuilder.Received(1).TrustManager;
        }
예제 #10
0
 public void CreatingOpenKitConfigurationFromNullBuilderGivesNull()
 {
     // when, then
     Assert.That(OpenKitConfiguration.From(null), Is.Null);
 }
예제 #11
0
 public BeaconSender(Configuration.OpenKitConfiguration configuration, IHTTPClientProvider clientProvider, ITimingProvider provider)
     : this(new BeaconSendingContext(configuration, clientProvider, provider))
 {
 }