Example #1
0
        public void DeleteTest()
        {
            Uri          address     = TargetFileUri;
            ICredentials credentials = Credentials;

            WebDavUtility.Delete(address, credentials);
        }
Example #2
0
        public void CreateTest()
        {
            Uri          address     = TargetFileUri;
            ICredentials credentials = Credentials;

            byte[] content = Encoding.UTF8.GetBytes("abcde");

            WebDavUtility.Create(address, content, credentials);
        }
Example #3
0
        public void ReadTest()
        {
            Uri          address     = TargetFileUri;
            ICredentials credentials = Credentials;

            byte[] expected = Encoding.UTF8.GetBytes("abcde");

            byte[] actual = WebDavUtility.Read(address, credentials);
            CollectionAssert.AreEqual(expected, actual);
        }
Example #4
0
        public void GetChildrenTest()
        {
            Uri          address     = TargetDirectoryUri;
            ICredentials credentials = Credentials;

            var actual = WebDavUtility.GetChildren(address, Credentials);

            actual.ForEachExecute(e => Console.WriteLine(e.Uri.GetName()));
            Assert.Inconclusive("出力結果を目視で確認してください。");
        }
Example #5
0
        public void OpenUpdateTest()
        {
            Uri          address     = TargetFileUri;
            ICredentials credentials = Credentials;

            byte[] content = Encoding.UTF8.GetBytes("abcdefghij");

            using (var input = new MemoryStream(content))
                using (var output = WebDavUtility.OpenUpdate(address, credentials))
                {
                    input.CopyTo(output);
                }
        }
Example #6
0
        public void OpenReadTest()
        {
            Uri          address     = TargetFileUri;
            ICredentials credentials = Credentials;

            byte[] expected = Encoding.UTF8.GetBytes("abcde");

            using (var input = WebDavUtility.OpenRead(address, credentials))
                using (var output = new MemoryStream())
                {
                    input.CopyTo(output);
                    byte[] actual = output.ToArray();

                    CollectionAssert.AreEqual(expected, actual);
                }
        }