Make GivenThatICopyLibraryAssets repeatable

This commit is contained in:
PiotrP 2016-08-08 13:44:44 -07:00
parent 79648f9ccb
commit f277103831

View file

@ -60,6 +60,13 @@ namespace Microsoft.DotNet.Cli.Compiler.Common.Tests
var mockedLibraryAssetFileName = $"{mockedLibraryAssetName}.dll";
var fakeFile = Path.Combine(AppContext.BaseDirectory, mockedLibraryAssetFileName);
if (File.Exists(fakeFile))
{
File.SetAttributes(fakeFile, FileAttributes.Normal);
File.Delete(fakeFile);
}
File.WriteAllText(fakeFile, mockedLibraryAssetName);
return new LibraryAsset(mockedLibraryAssetName, mockedLibraryAssetFileName, fakeFile);