1

Closed

When running the 3 tests from PurchaseRequisitionTest together, the third test fails

description

When running the 3 tests from PurchaseRequisitionTest together, the third test fails with this error:

Test method PurchaseRequisitionTest.UnitTest1.ExplicitlyDeniedPurchaseRequest threw exception: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters..

I think the problem is in that project's Artifacts.tt/Artifacts.cs :

File = this.FindXmlNodeAndReplace("/*[local-name()='PurchaseReq' and namespace-uri()='...", id);

Every call to FindXmlNodeAndReplace makes the file name longer (append a new Guid to the file name).

When a test is run alone, the file name is still short enough. But when the 3 tests are run, we end with a very long name (PurchaseApprovalRequest.xml.Guid1.Guid2.Guid3.Guid4.Guid5...) because the 3 tests share the same static instance of PurchaseReqFileType.
Closed Feb 26, 2010 at 12:07 PM by haddock747

comments

haddock747 wrote Feb 26, 2010 at 11:52 AM

reported by ckarras

wrote Feb 26, 2010 at 12:07 PM

Resolved with changeset 40006.

wrote Feb 13, 2013 at 8:29 PM

wrote May 16, 2013 at 3:27 AM