Exemplo n.º 1
0
        public void WordGetDocumentPropertiesTest()
        {
            var apiKey = new Dictionary <string, string>()
            {
                { "AppSecret", "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" },
                { "AppId", "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" }
            };

            var config = new Configuration(apiKey: apiKey);

            config.ApiClient = new ApiClient(config);

            var word   = new WordApi(config);
            var result = word.WordGetDocumentProperties("letterlegal5.doc");

            Assert.AreEqual("Sample document created with MS Word", result["Title"]);
        }
Exemplo n.º 2
0
        public void WordSetDocumentPropertiesTest()
        {
            var apiKey = new Dictionary <string, string>()
            {
                { "AppSecret", "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" },
                { "AppId", "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" }
            };

            var config = new Configuration(apiKey: apiKey);

            config.ApiClient = new ApiClient(config);

            var word = new WordApi(config);
            var prop = new Properties();

            prop.Add("Title", "Set Metadata Test");
            word.WordSetDocumentProperties("letterlegal5.doc", "letterlegal5_metadata.doc", prop);

            var result = word.WordGetDocumentProperties("letterlegal5_metadata.doc");

            Assert.AreEqual("Set Metadata Test", result["Title"]);
        }