public void ConvertSDKToSDK()
 {
     sdkDocument1 = CreateTypicalSDKDocument();
     converter = new DocumentConverter(sdkDocument1);
     sdkDocument2 = converter.ToSDKDocument();
     Assert.IsNotNull(sdkDocument2);
     Assert.AreEqual(sdkDocument2, sdkDocument1);
 }
        public void ConvertAPIToSDK()
        {
            apiDocument1 = CreateTypicalAPIDocument();
            sdkDocument1 = new DocumentConverter(apiDocument1, apiPackage).ToSDKDocument();

            Assert.IsNotNull(sdkDocument1);
            Assert.AreEqual(sdkDocument1.Name, apiDocument1.Name);
            Assert.AreEqual(sdkDocument1.Description, apiDocument1.Description);
            Assert.AreEqual(sdkDocument1.Index, apiDocument1.Index);
            Assert.AreEqual(sdkDocument1.Id, apiDocument1.Id);
        }
Пример #3
0
 public void UploadDocument(String fileName, byte[] fileContent, Document document, DocumentPackage documentPackage)
 {
     Silanis.ESL.API.Package packageToCreate = documentPackage.ToAPIPackage();
     packageService.UploadDocument(documentPackage.Id, fileName, fileContent, document.ToAPIDocument(packageToCreate));
 }
        public void ConvertToAPIWithNullId()
        {
            sdkDocument1 = DocumentBuilder.NewDocumentNamed( "sdkDocumentNullId" )
                .WithDescription( "sdkDocument with null ID" )
                    .FromFile(file.FullName)
                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                   .OnPage(0))                                
                    .Build();

            converter = new DocumentConverter(sdkDocument1);
            Assert.IsNull(converter.ToAPIDocument().Id);
        }
        public void ConvertSDKToAPI()
        {
            sdkDocument1 = CreateTypicalSDKDocument();
            apiDocument1 = new DocumentConverter(sdkDocument1).ToAPIDocument();

            Assert.IsNotNull(apiDocument1);
            Assert.AreEqual(sdkDocument1.Name, apiDocument1.Name);
            Assert.AreEqual(sdkDocument1.Description, apiDocument1.Description);
            Assert.AreEqual(sdkDocument1.Index, apiDocument1.Index);
            Assert.AreEqual(sdkDocument1.Id, apiDocument1.Id);
        }
 public void ConvertNullSDKToSDK()
 {
     sdkDocument1 = null;
     converter = new DocumentConverter(sdkDocument1);
     Assert.IsNull(converter.ToSDKDocument());
 }
 public void ConvertNullSDKToAPI()
 {
     sdkDocument1 = null;
     converter    = new DocumentConverter(sdkDocument1);
     Assert.IsNull(converter.ToAPIDocument());
 }