private OneSpanSign.API.DocumentVisibilityConfiguration CreateTypicalAPIDocumentVisibilityConfiguration() 
 {
     OneSpanSign.API.DocumentVisibilityConfiguration configuration = new OneSpanSign.API.DocumentVisibilityConfiguration();
     configuration.DocumentUid = "docId";
     configuration.RoleUids = new List<string>{"role1Id", "role2Id"};
     return configuration;
 }
        public void convertAPIToAPI() {
            apiVisibilityConfiguration1 = CreateTypicalAPIDocumentVisibilityConfiguration();
            apiVisibilityConfiguration2 = new DocumentVisibilityConfigurationConverter(apiVisibilityConfiguration1).ToAPIVisibilityConfiguration();

            Assert.IsNotNull(apiVisibilityConfiguration2);
            Assert.AreEqual(apiVisibilityConfiguration1, apiVisibilityConfiguration2);
        }
        public void convertSDKToAPI() {
            sdkVisibilityConfiguration1 = CreateTypicalSDKDocumentVisibilityConfiguration();
            apiVisibilityConfiguration1 = new DocumentVisibilityConfigurationConverter(sdkVisibilityConfiguration1).ToAPIVisibilityConfiguration();

            Assert.IsNotNull(apiVisibilityConfiguration1);
            Assert.AreEqual(sdkVisibilityConfiguration1.DocumentUid, apiVisibilityConfiguration1.DocumentUid);
            Assert.AreEqual(2, apiVisibilityConfiguration1.RoleUids.Count);
            CollectionAssert.AreEqual(sdkVisibilityConfiguration1.SignerIds, apiVisibilityConfiguration1.RoleUids);
        }
        public void convertAPIToSDK() {
            apiVisibilityConfiguration1 = CreateTypicalAPIDocumentVisibilityConfiguration();
            sdkVisibilityConfiguration1 = new DocumentVisibilityConfigurationConverter(apiVisibilityConfiguration1).ToSDKVisibilityConfiguration();

            Assert.IsNotNull(sdkVisibilityConfiguration1);
            Assert.AreEqual(apiVisibilityConfiguration1.DocumentUid, sdkVisibilityConfiguration1.DocumentUid);
            Assert.AreEqual(2, sdkVisibilityConfiguration1.SignerIds.Count);
            CollectionAssert.AreEqual(apiVisibilityConfiguration1.RoleUids, sdkVisibilityConfiguration1.SignerIds);
        }
コード例 #5
0
        private OneSpanSign.API.DocumentVisibility CreateTypicalAPIDocumentVisibility()
        {
            OneSpanSign.API.DocumentVisibility visibility = new OneSpanSign.API.DocumentVisibility();
            OneSpanSign.API.DocumentVisibilityConfiguration configuration1 = new OneSpanSign.API.DocumentVisibilityConfiguration();
            configuration1.DocumentUid = "doc1Id";
            configuration1.RoleUids    = new List <string> {
                "role1Id", "role2Id"
            };

            OneSpanSign.API.DocumentVisibilityConfiguration configuration2 = new OneSpanSign.API.DocumentVisibilityConfiguration();
            configuration2.DocumentUid = "doc2Id";
            configuration2.RoleUids    = new List <string> {
                "role2Id", "role3Id"
            };

            visibility.AddConfiguration(configuration1);
            visibility.AddConfiguration(configuration2);

            return(visibility);
        }
 public void convertNullAPIToAPI() {
     apiVisibilityConfiguration1 = null;
     converter = new DocumentVisibilityConfigurationConverter(apiVisibilityConfiguration1);
     Assert.IsNull(converter.ToAPIVisibilityConfiguration());
 }