Find Original Path of Assembly while in test.
Namespace:
TypeMock
Assembly:
Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 9.3.6.0 (9.3.6.0)
public static string GetOriginalPath(
Assembly assembly
)
Public Shared Function GetOriginalPath (
assembly As Assembly
) As String
Parameters
- assembly
- Type: System.ReflectionAssembly
An Assembly that is part of the test
Return Value
Type:
Stringpath to original location
Typemock Smart Runner, copies all assemblies to a shadow copy in order to allow developers to continue to build while the tests are run.
This is a helper method to reach original location
[Test]
public void Test_That_Calls_A_File()
{
var fileLocation = RunnerUtils.GetOriginalPath(typeof(UnderTest).Assembly);
var file = Path.Combine(Path.GetDirectoryName(fileLocation), "mydatabase.db");
var result = UnderTest.ReadAllUsersIn(file);
// Assert
}
Reference