1
首先,偉大的圖書館!ApprovalTests ....編譯後移動程序集
如果我編譯,然後移動程序集,當我驗證它仍然在尋找* .approved.txt它編譯的位置,在我的情況下不再存在。
我在Teamcity上遇到了這個問題,我們在這個問題上構建並測試了單獨的任務。 因此,生成步驟將建立在C:\ BuildAgent \ SomeGuid ... 我從構建的工件,並在c:\ BuildAgent \ SomeOtherGuid運行測試... 由於Approvals.Verify仍然引用「SomeGuid 「
[Fact]
public void ShouldCreateCorrectOutgoingFiles() {
var textToVerfiy = "Here's some text To Verify";
Approvals.Verify(textToVerfiy);
}
...
: System.IO.DirectoryNotFoundException : Could not find a part of the path 'r:\w\254cbbd5ec9b56bc\project\ScenarioTests\myTests'.
Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at System.IO.Directory.CreateDirectory(String path)
at ApprovalTests.ApprovalTextWriter.WriteReceivedFile(String received)
at ApprovalTests.Approvers.FileApprover.Approve()
at ApprovalTests.Core.Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer)
at ApprovalTests.Approvals.Verify(String text)
我如何可以調整它的任何想法看起來相對目錄下的可執行文件。
這些鏈接現在有點破了,因爲你把你的代碼移動到了GitHub。你能提供一個非鏈接唯一的答案嗎? –