GetServerFolderShare() public method

public GetServerFolderShare ( string sInPath, string &sServerFolderShare ) : bool
sInPath string
sServerFolderShare string
return bool
示例#1
0
        public void FileSystemQuery_GetServerFolderShare_PathLength_ExpectFalse()
        {
            //------------Setup for test--------------------------

            //------------Execute Test---------------------------
            var query = new FileSystemQuery();
            string sServerFolderShare;
            var res = query.GetServerFolderShare("bob", out sServerFolderShare);
            //------------Assert Results-------------------------
            Assert.IsFalse(res);
        }
示例#2
0
        public void FileSystemQuery_GetServerFolderShare_MultipleSlashesNoShareName_ExpectFalse()
        {
            //------------Setup for test--------------------------

            //------------Execute Test---------------------------
            var query = new FileSystemQuery();
            string sServerFolderShare;
            var res = query.GetServerFolderShare("\\\\bobthebuilder", out sServerFolderShare);
            //------------Assert Results-------------------------
            Assert.IsFalse(res);
        }
示例#3
0
        public void FileSystemQuery_GetServerFolderShare_MultipleSlashesShareName_ExpectTrue()
        {
            //------------Setup for test--------------------------
            var dir = new Mock<IDirectory>();
            dir.Setup(a => a.Exists("\\\\bobthebuilder\\dave")).Returns(true);

            //------------Execute Test---------------------------
            var query = new FileSystemQuery(dir.Object, new DirectoryEntryFactory(),new ShareCollectionFactory());
            string sServerFolderShare;
            var res = query.GetServerFolderShare("\\\\bobthebuilder\\dave", out sServerFolderShare);
            //------------Assert Results-------------------------
            Assert.IsTrue(res);
        }
示例#4
0
        public void FileSystemQuery_GetServerFolderShare_DefaultValue_ExpectTrue()
        {
            //------------Setup for test--------------------------
            var dir = new Mock<IDirectory>();
            dir.Setup(a => a.Exists("\\\\bobthebuilder\\dave")).Returns(false).Verifiable();

            //------------Execute Test---------------------------
            var query = new FileSystemQuery(dir.Object, new DirectoryEntryFactory(), new ShareCollectionFactory());
            string sServerFolderShare;
            var res = query.GetServerFolderShare("\\\\bobthebuilder\\dave\\", out sServerFolderShare);
            //------------Assert Results-------------------------
            Assert.IsTrue(res);
            Assert.AreEqual(@"\\BOBTHEBUILDER\DAVE\",sServerFolderShare);
        }