public void ConvertNullAPIToAPI()
        {
            apiAuth1  = null;
            converter = new AuthenticationConverter(apiAuth1);

            Assert.IsNull(converter.ToAPIAuthentication());
        }
        public void ConvertAPIToAPI()
        {
            apiAuth1  = CreateTypicalAPIAuthentication();
            converter = new AuthenticationConverter(apiAuth1);
            apiAuth2  = converter.ToAPIAuthentication();

            Assert.IsNotNull(apiAuth2);
            Assert.AreEqual(apiAuth2, apiAuth1);
        }
        public void ConvertSDKToAPI()
        {
            sdkAuth1 = CreateTypicalSDKAuthentication();
            apiAuth1 = new AuthenticationConverter(sdkAuth1).ToAPIAuthentication();

            Assert.IsNotNull(apiAuth1);
            Assert.AreEqual(apiAuth1.Scheme, sdkAuth1.Method.getApiValue());
            Assert.AreEqual(apiAuth1.Challenges[0].Question, sdkAuth1.Challenges[0].Question);
            Assert.AreEqual(apiAuth1.Challenges[0].Answer, sdkAuth1.Challenges[0].Answer);
        }
        public void ConvertAPIToSDK()
        {
            apiAuth1 = CreateTypicalAPIAuthentication();
            sdkAuth1 = new AuthenticationConverter(apiAuth1).ToSDKAuthentication();

            Assert.IsNotNull(sdkAuth1);
            Assert.AreEqual(sdkAuth1.Method.getApiValue(), apiAuth1.Scheme);
            Assert.AreEqual(sdkAuth1.Challenges[0].Question, apiAuth1.Challenges[0].Question);
            Assert.AreEqual(sdkAuth1.Challenges[0].Answer, apiAuth1.Challenges[0].Answer);
        }
        private OneSpanSign.API.Auth CreateTypicalAPIAuthentication()
        {
            OneSpanSign.API.Auth          result        = new OneSpanSign.API.Auth();
            OneSpanSign.API.AuthChallenge authChallenge = new OneSpanSign.API.AuthChallenge();
            authChallenge.Question  = "What is the name of your dog?";
            authChallenge.Answer    = "Max";
            authChallenge.MaskInput = true;
            result.AddChallenge(authChallenge);
            result.Scheme = OneSpanSign.Sdk.AuthenticationMethod.CHALLENGE.getApiValue();

            return(result);
        }