Beispiel #1
0
        public void Matches_Drive()
        {
            var rule  = new AttributeRule();
            var drive = new DriveObject(@"C:", null);

            var result = rule.Matches(drive, null);
        }
Beispiel #2
0
        public void Matches_File_False()
        {
            var fileSystem = new MockFileSystem();

            fileSystem.RegisterFile(@"C:\file");

            var rule = new AttributeRule(FileAttributes.Hidden);
            var file = new FileObject(@"C:\file", fileSystem);

            var result = rule.Matches(file, null);

            Assert.AreEqual(false, result);
        }
Beispiel #3
0
        public void Matches_Directory_Directory()
        {
            var fileSystem = new MockFileSystem();

            fileSystem.RegisterDirectory(@"C:\dir");

            var rule      = new AttributeRule(FileAttributes.Directory);
            var directory = new DirectoryObject(@"C:\dir", fileSystem);

            var result = rule.Matches(directory, null);

            Assert.AreEqual(true, result);
        }
Beispiel #4
0
        public void Matches_File_True()
        {
            var fileSystem = new MockFileSystem();

            fileSystem.RegisterFile(@"C:\file", FileAttributes.Archive);

            var rule = new AttributeRule(FileAttributes.Archive);
            var file = new FileObject(@"C:\file", fileSystem);

            var result = rule.Matches(file, null);

            Assert.AreEqual(true, result);
        }