The changes support the fact the CF does not have a CurrentDirectory,

CF does not have a CurrentDirectory, and consequently, will not allow
relative paths or file names in any file or directory method.  These
fixes solve that problem.
I read the coding standard in detail, and it does not specify that anywhere.  So I used the “standard” that is used most in the C# programming community.  Perhaps this should be added to the coding standards document then?

 

From: Rob Prouse [mailto:notifications@github.com] 
Sent: Friday, November 21, 2014 10:17 PM
To: nunit/nunit
Cc: oznetmaster
Subject: Re: [nunit] The changes support the fact the CF does not have a CurrentDirectory, (#376)

 

In src/NUnitFramework/tests/Assertions/FileAssertTests.cs:

> @@ -57,88 +71,91 @@ public void AreEqualPassesWithSameStream()
>          [Test]
>          public void AreEqualPassesWithEqualStreams()
>          {
> -            using (new TestFile("Test1.jpg", "TestImage1.jpg"))
> -            using (new TestFile("Test2.jpg", "TestImage1.jpg"))
> -            using (FileStream expected = File.OpenRead("Test1.jpg"))
> -            using (FileStream actual = File.OpenRead("Test2.jpg"))
> -            {
> -                FileAssert.AreEqual(expected, actual);
> -            }
> +            using (new TestFile(TF("Test1.jpg"), "TestImage1.jpg"))
> +                using (new TestFile(TF("Test2.jpg"), "TestImage1.jpg"))
> +                    using (FileStream expected = File.OpenRead(TF("Test1.jpg")))
> +                        using (FileStream actual = File.OpenRead(TF("Test2.jpg")))

Our coding standard is to not indent multiple usings like this.

—
Reply to this email directly or view it on GitHub <https://github.com/nunit/nunit/pull/376/files#r20716511> .  <https://github.com/notifications/beacon/AFh64dBPYCTd4pDmOtqaDoMGhuRxMrV2ks5nP0DZgaJpZM4C-3B0.gif>