[iOS] Fix ZipPackage_CreateWithFileAccessWrite test (#72850)
authorSteve Pfister <steveisok@users.noreply.github.com>
Wed, 27 Jul 2022 01:36:59 +0000 (18:36 -0700)
committerGitHub <noreply@github.com>
Wed, 27 Jul 2022 01:36:59 +0000 (21:36 -0400)
On iOS, this test was failing due to not being able to write files in the app root directory.  The fix is to write a file in the TestDirectory, which is a subdirectory under the app root and is writeable.

Fixes https://github.com/dotnet/runtime/issues/72837

src/libraries/System.IO.Packaging/tests/Tests.cs

index 8dd92b4..82e36f4 100644 (file)
@@ -3698,7 +3698,7 @@ namespace System.IO.Packaging.Tests
         [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Desktop doesn't support Package.Open with FileAccess.Write")]
         public void ZipPackage_CreateWithFileAccessWrite()
         {
-            string packageName = "test.zip";
+            string packageName = Path.Combine(TestDirectory, "test.zip");
 
             using (Package package = Package.Open(packageName, FileMode.Create, FileAccess.Write))
             {