コード例 #1
0
        public void Constructor_TempFile_TempFileAttributeSet()
        {
            var path = @".\Test Data\tmp.tmp";
            File.Create(path).Dispose();

            var file = new DesktopFileReference(path) { IsTempFile = true };
            Assert.True((File.GetAttributes(path) & FileAttributes.Temporary) == FileAttributes.Temporary);
        }
コード例 #2
0
        public void Constructor_RegularFile_TempFileAttributeNotSet()
        {
            var path = @".\Test Data\nontmp.tmp";
            File.Create(path).Dispose();

            var file = new DesktopFileReference(path);
            Assert.False((File.GetAttributes(path) & FileAttributes.Temporary) == FileAttributes.Temporary);
        }
コード例 #3
0
        public void Constructor_RegularFile_TempFileAttributeNotSet()
        {
            var path = @".\Test Data\nontmp.tmp";

            File.Create(path).Dispose();

            var file = new DesktopFileReference(path);

            Assert.False((File.GetAttributes(path) & FileAttributes.Temporary) == FileAttributes.Temporary);
        }
コード例 #4
0
        public void Constructor_TempFile_TempFileAttributeSet()
        {
            var path = @".\Test Data\tmp.tmp";

            File.Create(path).Dispose();

            var file = new DesktopFileReference(path)
            {
                IsTempFile = true
            };

            Assert.True((File.GetAttributes(path) & FileAttributes.Temporary) == FileAttributes.Temporary);
        }