← Back to team overview

nunit-core team mailing list archive

[Bug 574408] Re: DirectoryAssert fails to recognise the sub folder using IsWithin

 

** Also affects: nunit-3.0
   Importance: Undecided
       Status: New

** Changed in: nunit-3.0
       Status: New => Triaged

** Changed in: nunit-3.0
   Importance: Undecided => High

** Changed in: nunitv2
    Milestone: None => 2.5.6

-- 
DirectoryAssert fails to recognise the sub folder using IsWithin
https://bugs.launchpad.net/bugs/574408
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

Status in NUnit Test Framework: Triaged
Status in NUnit V2 Test Framework: Fix Committed

Bug description:
Fails to recognize the second path was the direct sub directory.


            var tempPath = Path.GetTempPath();
            var tempPathParent = Path.GetDirectoryName(Path.GetDirectoryName(tempPath));

            DirectoryAssert.AreEqual(new DirectoryInfo(tempPath), new DirectoryInfo(tempPath));

            Assert.That(tempPath, Is.SamePathOrUnder(tempPathParent));

            // bugs??
            DirectoryAssert.IsWithin(tempPathParent, tempPath);    // failed the tests





References