Assert.Equal(new DateTime(1980, 1, 1, 0, 0, 0), archive.Entries[0].LastWriteTime.DateTime);
}
- FileInfo fileWithBadDate = new FileInfo(GetTestFilePath());
- fileWithBadDate.Create().Dispose();
- fileWithBadDate.LastWriteTimeUtc = new DateTime(1970, 1, 1, 1, 1, 1);
-
- string archivePath = GetTestFilePath();
- using (FileStream output = File.Open(archivePath, FileMode.Create))
- using (ZipArchive archive = new ZipArchive(output, ZipArchiveMode.Create))
- {
- archive.CreateEntryFromFile(fileWithBadDate.FullName, "SomeEntryName");
- }
- using (ZipArchive archive = ZipFile.OpenRead(archivePath))
+ // Browser VFS does not support saving file attributes, so skip
+ if (!PlatformDetection.IsBrowser)
{
- Assert.Equal(new DateTime(1980, 1, 1, 0, 0, 0), archive.Entries[0].LastWriteTime.DateTime);
+ FileInfo fileWithBadDate = new FileInfo(GetTestFilePath());
+ fileWithBadDate.Create().Dispose();
+ fileWithBadDate.LastWriteTimeUtc = new DateTime(1970, 1, 1, 1, 1, 1);
+
+ string archivePath = GetTestFilePath();
+ using (FileStream output = File.Open(archivePath, FileMode.Create))
+ using (ZipArchive archive = new ZipArchive(output, ZipArchiveMode.Create))
+ {
+ archive.CreateEntryFromFile(fileWithBadDate.FullName, "SomeEntryName");
+ }
+ using (ZipArchive archive = ZipFile.OpenRead(archivePath))
+ {
+ Assert.Equal(new DateTime(1980, 1, 1, 0, 0, 0), archive.Entries[0].LastWriteTime.DateTime);
+ }
}
}
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization.Calendars\tests\System.Globalization.Calendars.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization.Extensions\tests\System.Globalization.Extensions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\System.Globalization.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Compression.ZipFile\tests\System.IO.Compression.ZipFile.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Compression\tests\System.IO.Compression.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem.DriveInfo\tests\System.IO.FileSystem.DriveInfo.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem\tests\System.IO.FileSystem.Tests.csproj" />