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

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

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

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

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

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

            // then
            Assert.That(target.ApplicationVersion, Is.EqualTo(ApplicationVersion));
            _ = mockOpenKitBuilder.Received(1).ApplicationVersion;
        }
Beispiel #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"));
        }
Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #10
0
 public void CreatingOpenKitConfigurationFromNullBuilderGivesNull()
 {
     // when, then
     Assert.That(OpenKitConfiguration.From(null), Is.Null);
 }