Exemplo n.º 1
0
        public void convertSDKToSDK()
        {
            sdkEventNotificationConfig1 = CreateTypicalSDKEventNotificationConfig();
            sdkEventNotificationConfig2 = new EventNotificationConfigConverter(sdkEventNotificationConfig1).ToSDKEventNotificationConfig();

            Assert.IsNotNull(sdkEventNotificationConfig2);
            Assert.AreEqual(sdkEventNotificationConfig2, sdkEventNotificationConfig1);
        }
Exemplo n.º 2
0
        public EventNotificationConfig build()
        {
            EventNotificationConfig result = new EventNotificationConfig(url);

            result.Key = key;
            foreach (NotificationEvent notificationEvent in events)
            {
                result.NotificationEvents.Add(notificationEvent);
            }

            return(result);
        }
Exemplo n.º 3
0
        public void convertSDKToAPI()
        {
            sdkEventNotificationConfig1 = CreateTypicalSDKEventNotificationConfig();
            apiCallback1 = new EventNotificationConfigConverter(sdkEventNotificationConfig1).ToAPICallback();

            Assert.IsNotNull(apiCallback1);
            Assert.AreEqual(apiCallback1.Url, sdkEventNotificationConfig1.Url);
            Assert.AreEqual(apiCallback1.Events.Count, 3);
            Assert.AreEqual(apiCallback1.Events[0], sdkEventNotificationConfig1.NotificationEvents[0].getApiValue());
            Assert.AreEqual(apiCallback1.Events[1], sdkEventNotificationConfig1.NotificationEvents[1].getApiValue());
            Assert.AreEqual(apiCallback1.Events[2], sdkEventNotificationConfig1.NotificationEvents[2].getApiValue());
        }
Exemplo n.º 4
0
        public void convertAPIToSDK()
        {
            apiCallback1 = CreateTypicalAPICallback();
            sdkEventNotificationConfig1 = new EventNotificationConfigConverter(apiCallback1).ToSDKEventNotificationConfig();

            Assert.IsNotNull(sdkEventNotificationConfig1);
            Assert.AreEqual(sdkEventNotificationConfig1.Url, apiCallback1.Url);
            Assert.AreEqual(sdkEventNotificationConfig1.NotificationEvents.Count, 3);
            Assert.AreEqual(sdkEventNotificationConfig1.NotificationEvents[0].getApiValue(), apiCallback1.Events[0]);
            Assert.AreEqual(sdkEventNotificationConfig1.NotificationEvents[1].getApiValue(), apiCallback1.Events[1]);
            Assert.AreEqual(sdkEventNotificationConfig1.NotificationEvents[2].getApiValue(), apiCallback1.Events[2]);
        }
Exemplo n.º 5
0
        public OneSpanSign.Sdk.EventNotificationConfig ToSDKEventNotificationConfig()
        {
            if (apiCallback == null)
            {
                return(sdkEventNotificationConfig);
            }

            EventNotificationConfig eventNotificationConfig = new EventNotificationConfig(apiCallback.Url);

            eventNotificationConfig.Key = apiCallback.Key;
            foreach (string callbackEvent in apiCallback.Events)
            {
                eventNotificationConfig.AddEvent(new EventNotificationConverter(callbackEvent).ToSDKNotificationEvent());
            }

            return(eventNotificationConfig);
        }
Exemplo n.º 6
0
 public void convertNullSDKToSDK()
 {
     sdkEventNotificationConfig1 = null;
     converter = new EventNotificationConfigConverter(sdkEventNotificationConfig1);
     Assert.IsNull(converter.ToSDKEventNotificationConfig());
 }