public void ComponentSetAttributeAction_For_NonExisting_File() { string fileNameCopied = "ComponentSetAttributeAction_For_NonExisting_File.txt"; _pathCopied = Path.Combine(_assemblyFolder, fileNameCopied); Assert.DoesNotThrow(() => FileLibrary.ComponentSetAttributeAction(_pathCopied, FileAttributes.ReadOnly)); }
public void ComponentSetAttributeAction_For_Existing_File() { // Set up temporary sample file to alter string fileNameCopied = "ComponentSetAttributeAction_For_Existing_File.txt"; _pathCopied = Path.Combine(_assemblyFolder, fileNameCopied); File.Copy(_pathOriginal, _pathCopied); FileLibrary.ComponentSetAttributeAction(_pathCopied, FileAttributes.ReadOnly); Assert.AreEqual(FileAttributes.ReadOnly, (File.GetAttributes(_pathCopied) & FileAttributes.ReadOnly)); }