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

            var result = rule.Matches(drive, null);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }