Beispiel #1
0
        public void SharePointConnectorGetFile2Test()
        {
            SharePointConnector spConnector = new SharePointConnector(TestCommon.CreateClientContext(), TestCommon.DevSiteUrl, testContainerSecure);

            string file = spConnector.GetFile("ProvisioningTemplate-2015-03-Sample-01.xml", String.Format("{0}/sub1/sub11", testContainerSecure));

            Assert.IsNotNull(file);

            string file2 = spConnector.GetFile("Idonotexist.xml", String.Format("{0}/sub1/sub11", testContainerSecure));

            Assert.IsNull(file2);
        }
Beispiel #2
0
        public void SharePointConnectorGetFile1Test()
        {
            SharePointConnector spConnector = new SharePointConnector();

            spConnector.Parameters.Add(AzureStorageConnector.CONNECTIONSTRING, TestCommon.DevSiteUrl);
            spConnector.Parameters.Add(AzureStorageConnector.CONTAINER, testContainerSecure);
            spConnector.Parameters.Add(SharePointConnector.CLIENTCONTEXT, TestCommon.CreateClientContext());

            string file = spConnector.GetFile("ProvisioningTemplate-2015-03-Sample-01.xml");

            Assert.IsNotNull(file);

            string file2 = spConnector.GetFile("Idonotexist.xml");

            Assert.IsNull(file2);
        }
Beispiel #3
0
        public void SharePointConnectorGetFileFromWebRootFolder()
        {
            SharePointConnector spConnector = new SharePointConnector();

            spConnector.Parameters.Add(SharePointConnector.CONNECTIONSTRING, TestCommon.DevSiteUrl);
            spConnector.Parameters.Add(SharePointConnector.CLIENTCONTEXT, TestCommon.CreateClientContext());

            string file = spConnector.GetFile("TestDefault.aspx");

            Assert.IsNotNull(file);
        }
Beispiel #4
0
        public void SharePointConnectorGetFileBytes2Test()
        {
            SharePointConnector spConnector = new SharePointConnector();

            spConnector.Parameters.Add(AzureStorageConnector.CONNECTIONSTRING, TestCommon.DevSiteUrl);
            spConnector.Parameters.Add(AzureStorageConnector.CONTAINER, testContainerSecure);
            spConnector.Parameters.Add(SharePointConnector.CLIENTCONTEXT, TestCommon.CreateClientContext());

            using (var bytes = spConnector.GetFileStream("custombg.jpg", String.Format("{0}/sub1", testContainerSecure)))
            {
                Assert.IsTrue(bytes.Length > 0);
            }

            string file2 = spConnector.GetFile("Idonotexist.xml", String.Format("{0}/sub1", testContainerSecure));

            Assert.IsNull(file2);
        }