コード例 #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))
 {
 }