mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
Add projects for FileSystem and FileSystem.Primitives. Add tests for FS.Primitives and the begining of tests for FileSystem.
Commit migrated from https://github.com/dotnet/corefx/commit/5b0e138913de4854ed2a4c627fa75362413d2010
This commit is contained in:
1 parent
4ee2e489bb
commit
6923cfab70
17 files changed
+695
-2
No files matched your search
@@ -3,7 +3,6 @@
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
|
||||
<ProjectGuid>{6C05678E-394C-4CFF-B453-A18E28C8F2C3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AssemblyName>System.IO.FileSystem.Primitives</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="System\IO\FileAccess.cs" />
|
||||
<Compile Include="System\IO\FileAttributes.cs" />
|
||||
<Compile Include="System\IO\FileMode.cs" />
|
||||
<Compile Include="System\IO\FileShare.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.Runtime" version="4.0.20-beta-22412" targetFramework="portable-net45+win+wpa81" />
|
||||
</packages>
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace System.IO.Tests
|
||||
{
|
||||
public static class FileAccessTests
|
||||
{
|
||||
[Fact]
|
||||
public static void ValueTest()
|
||||
{
|
||||
Assert.Equal(1, (int)FileAccess.Read);
|
||||
Assert.Equal(2, (int)FileAccess.Write);
|
||||
Assert.Equal(3, (int)FileAccess.ReadWrite);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace System.IO.Tests
|
||||
{
|
||||
public static class FileAttributesTests
|
||||
{
|
||||
[Fact]
|
||||
public static void ValueTest()
|
||||
{
|
||||
Assert.Equal(0x0001, (int)FileAttributes.ReadOnly);
|
||||
Assert.Equal(0x0002, (int)FileAttributes.Hidden);
|
||||
Assert.Equal(0x0004, (int)FileAttributes.System);
|
||||
Assert.Equal(0x0010, (int)FileAttributes.Directory);
|
||||
Assert.Equal(0x0020, (int)FileAttributes.Archive);
|
||||
Assert.Equal(0x0040, (int)FileAttributes.Device);
|
||||
Assert.Equal(0x0080, (int)FileAttributes.Normal);
|
||||
Assert.Equal(0x0100, (int)FileAttributes.Temporary);
|
||||
Assert.Equal(0x0200, (int)FileAttributes.SparseFile);
|
||||
Assert.Equal(0x0400, (int)FileAttributes.ReparsePoint);
|
||||
Assert.Equal(0x0800, (int)FileAttributes.Compressed);
|
||||
Assert.Equal(0x1000, (int)FileAttributes.Offline);
|
||||
Assert.Equal(0x2000, (int)FileAttributes.NotContentIndexed);
|
||||
Assert.Equal(0x4000, (int)FileAttributes.Encrypted);
|
||||
Assert.Equal(0x8000, (int)FileAttributes.IntegrityStream);
|
||||
Assert.Equal(0x20000, (int)FileAttributes.NoScrubData);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace System.IO.Tests
|
||||
{
|
||||
public static class FileModeTests
|
||||
{
|
||||
[Fact]
|
||||
public static void ValueTest()
|
||||
{
|
||||
Assert.Equal(1, (int)FileMode.CreateNew);
|
||||
Assert.Equal(2, (int)FileMode.Create);
|
||||
Assert.Equal(3, (int)FileMode.Open);
|
||||
Assert.Equal(4, (int)FileMode.OpenOrCreate);
|
||||
Assert.Equal(5, (int)FileMode.Truncate);
|
||||
Assert.Equal(6, (int)FileMode.Append);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace System.IO.Tests
|
||||
{
|
||||
public static class FileShareTests
|
||||
{
|
||||
[Fact]
|
||||
public static void ValueTest()
|
||||
{
|
||||
Assert.Equal(0, (int)FileShare.None);
|
||||
Assert.Equal(1, (int)FileShare.Read);
|
||||
Assert.Equal(2, (int)FileShare.Write);
|
||||
Assert.Equal(3, (int)FileShare.ReadWrite);
|
||||
Assert.Equal(4, (int)FileShare.Delete);
|
||||
Assert.Equal(0x10, (int)FileShare.Inheritable);
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
|
||||
<ProjectGuid>{2EF7EFA5-F171-4CAB-8A29-32833949FD87}</ProjectGuid>
|
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AssemblyName>System.IO.FileSystem.Primitives.Tests</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Common\tests\XunitTraitsDiscoverers\XunitTraitsDiscoverers.csproj">
|
||||
<Project>{be8ed8c1-c314-4c4e-a929-64c9c8b3552a}</Project>
|
||||
<Name>XunitTraitsDiscoverers</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\System.IO.FileSystem.Primitives\src\System.IO.FileSystem.Primitives.csproj">
|
||||
<Project>{6c05678e-394c-4cff-b453-a18e28c8f2c3}</Project>
|
||||
<Name>System.IO.FileSystem.Primitives</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FileAccessTests.cs" />
|
||||
<Compile Include="FileAttributesTests.cs" />
|
||||
<Compile Include="FileModeTests.cs" />
|
||||
<Compile Include="FileShareTests.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.Runtime" version="4.0.20-beta-22412" targetFramework="portable-net45+win+wpa81" />
|
||||
<package id="xunit" version="2.0.0-beta5-build2785" targetFramework="portable-net45+win+wpa81+wp80" />
|
||||
<package id="xunit.abstractions" version="2.0.0-beta5-build2785" targetFramework="portable-net45+win+wpa81+wp80" />
|
||||
<package id="xunit.assert" version="2.0.0-beta5-build2785" targetFramework="portable-net45+win+wpa81+wp80" />
|
||||
<package id="xunit.core" version="2.0.0-beta5-build2785" targetFramework="portable-net45+win+wpa81+wp80" />
|
||||
</packages>
|
||||
Reference in new issue
Block a user