Beispiel #1
0
        public void FileFilterThrowsArgumentNull()
        {
            FileFilter filter = new FileFilter();

            Assert.Throws <ArgumentNullException>(() => filter.AddUnencryptable(null));
            Assert.Throws <ArgumentNullException>(() => filter.AddUnencryptableExtension(null));
            Assert.Throws <ArgumentNullException>(() => filter.IsEncryptable(null));
        }
Beispiel #2
0
        public void FileFilterTestUnencryptableExtension()
        {
            FileFilter filter = new FileFilter();

            filter.AddUnencryptableExtension("gdoc");

            Assert.That(filter.IsEncryptable(new FakeDataStore(@"file.gdoc")), Is.False);
            Assert.That(filter.IsEncryptable(new FakeDataStore(@"file..gdoc")), Is.False);
            Assert.That(filter.IsEncryptable(new FakeDataStore(@"anywhere\file.gdoc")), Is.False);
            Assert.That(filter.IsEncryptable(new FakeDataStore(@"file.gdoc\file.txt")), Is.True);
            Assert.That(filter.IsEncryptable(new FakeDataStore(@"filegdoc")), Is.True);
            Assert.That(filter.IsEncryptable(new FakeDataStore(@"filegdoc.txt")), Is.True);
        }