There is [SetUp]
part where some file is loaded for later tests.
It should be loaded with:
private string GiveFilePath()
{
string folder;
string assemblyPath;
assemblyPath = Assembly.GetExecutingAssembly().Location;
folder = new FileInfo(assemblyPath ).DirectoryName;
return folder + @"\" + FileNameAsConst;
}
But I get
System.IO.FileNotFoundException
in C:\Users\username\AppData\Local\Temp\...
cause its trying to load this file from AppData
and not from the projects folder.
There is the similiar question asked already. And the answer, that the author of the question have found himself is to set ShadowCopyFiles
property to true
.
But there is no any ShadowCopyFiles
in code or in config files.
Do you have any ideas?
Update:
[SetUp]
public void SetUp()
{
this.facade = new MyFacade();
}
[Test]
public void InstanceIsNotNull()
{
Assert.IsNotNull(facade);
}
...
public MyFacade()
{
FileStream fileStrem = new FileStream(GiveFilePath(), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
...
}