public void WhenGettingListOfFilesWithoutIgnorePattern_AllFilesAreReturned()
        {
            var fileSourceMock = new Mock<BulkFileEncrypter.IFileSource>();
            fileSourceMock.Setup(x => x.GetFilesRecursive(It.IsAny<string>())).Returns(fileList);

            var victim = new BulkFileEncrypter.EncryptCommandHelper(fileSourceMock.Object);

            var list = victim.CreateFileList("test", null);
            Assert.IsTrue(list.SequenceEqual(fileList), "Failed when ignorePattern = null");

            list = victim.CreateFileList("test", string.Empty);
            Assert.IsTrue(list.SequenceEqual(fileList), "Failed when ignorePattern = string.Empty");

            list = victim.CreateFileList("test", "   ");
            Assert.IsTrue(list.SequenceEqual(fileList), "Failed when ignorePattern is whitespace");
        }
Пример #2
0
        public void WhenGettingListOfFilesWithoutIgnorePattern_AllFilesAreReturned()
        {
            var fileSourceMock = new Mock <BulkFileEncrypter.IFileSource>();

            fileSourceMock.Setup(x => x.GetFilesRecursive(It.IsAny <string>())).Returns(fileList);

            var victim = new BulkFileEncrypter.EncryptCommandHelper(fileSourceMock.Object);

            var list = victim.CreateFileList("test", null);

            Assert.IsTrue(list.SequenceEqual(fileList), "Failed when ignorePattern = null");

            list = victim.CreateFileList("test", string.Empty);
            Assert.IsTrue(list.SequenceEqual(fileList), "Failed when ignorePattern = string.Empty");

            list = victim.CreateFileList("test", "   ");
            Assert.IsTrue(list.SequenceEqual(fileList), "Failed when ignorePattern is whitespace");
        }
        public void WhenGettingListOfFilesWithIgnorePattern_IgnoredFilesAreNotReturned()
        {
            var fileSourceMock = new Mock<BulkFileEncrypter.IFileSource>();
            fileSourceMock.Setup(x => x.GetFilesRecursive(It.IsAny<string>())).Returns(fileList);

            var victim = new BulkFileEncrypter.EncryptCommandHelper(fileSourceMock.Object);

            var list = victim.CreateFileList("test", "blah");
            Assert.IsTrue(list.All(x => !x.Contains("blah")));
        }
Пример #4
0
        public void WhenGettingListOfFilesWithIgnorePattern_IgnoredFilesAreNotReturned()
        {
            var fileSourceMock = new Mock <BulkFileEncrypter.IFileSource>();

            fileSourceMock.Setup(x => x.GetFilesRecursive(It.IsAny <string>())).Returns(fileList);

            var victim = new BulkFileEncrypter.EncryptCommandHelper(fileSourceMock.Object);

            var list = victim.CreateFileList("test", "blah");

            Assert.IsTrue(list.All(x => !x.Contains("blah")));
        }