1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-25 10:58:48 +00:00

Compare commits

...

3 Commits

178 changed files with 279 additions and 498 deletions

67
Directory.Build.props Normal file
View File

@ -0,0 +1,67 @@
<Project>
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<Optimize>true</Optimize>
<ImplicitUsings>true</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<VersionPrefix>4.0.0</VersionPrefix>
<Authors>Oliver Booth</Authors>
<Nullable>enable</Nullable>
<NeutralLanguage>en</NeutralLanguage>
<RepositoryUrl>https://github.com/oliverbooth/X10D</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>Extension methods on crack.</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>branding_Icon.png</PackageIcon>
<PackageIconUrl/>
<PackageTags>dotnet extension-methods</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(SolutionDir)/CHANGELOG.md"))</PackageReleaseNotes>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' == ''">
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' != ''">
<Version>$(VersionPrefix)-$(VersionSuffix).$(BuildNumber)</Version>
<AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>$(VersionPrefix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<ItemGroup>
<None Include="..\branding_Icon.png">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath/>
</None>
</ItemGroup>
</Project>

View File

@ -2,69 +2,11 @@
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Optimize>true</Optimize>
<ImplicitUsings>true</ImplicitUsings>
<Authors>Oliver Booth</Authors>
<NeutralLanguage>en</NeutralLanguage>
<RepositoryUrl>https://github.com/oliverbooth/X10D</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>Extension methods on crack.</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>branding_Icon.png</PackageIcon>
<PackageIconUrl/>
<PackageTags>dotnet extension-methods</PackageTags>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../CHANGELOG.md"))</PackageReleaseNotes>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<VersionPrefix>4.0.0</VersionPrefix>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ExcludeFromCodeCoverage>true</ExcludeFromCodeCoverage>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' == ''">
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' != ''">
<Version>$(VersionPrefix)-$(VersionSuffix).$(BuildNumber)</Version>
<AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>$(VersionPrefix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.3.0" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
<None Include="..\branding_Icon.png">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath/>
</None>
</ItemGroup>
</Project>

View File

@ -2,68 +2,10 @@
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Optimize>true</Optimize>
<ImplicitUsings>true</ImplicitUsings>
<Authors>Oliver Booth</Authors>
<NeutralLanguage>en</NeutralLanguage>
<RepositoryUrl>https://github.com/oliverbooth/X10D</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>Extension methods on crack.</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>branding_Icon.png</PackageIcon>
<PackageIconUrl/>
<PackageTags>dotnet extension-methods</PackageTags>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../CHANGELOG.md"))</PackageReleaseNotes>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<VersionPrefix>4.0.0</VersionPrefix>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' == ''">
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' != ''">
<Version>$(VersionPrefix)-$(VersionSuffix).$(BuildNumber)</Version>
<AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>$(VersionPrefix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0"/>
</ItemGroup>
<ItemGroup>
<None Include="..\branding_Icon.png">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath/>
</None>
</ItemGroup>
</Project>

View File

@ -2,12 +2,10 @@
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<CoverletOutputFormat>json,cobertura</CoverletOutputFormat>
<CollectCoverage>true</CollectCoverage>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">

View File

@ -1 +1 @@
[assembly: CLSCompliant(true)]
[assembly: CLSCompliant(false)]

View File

@ -3,10 +3,10 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
public partial class ArrayTests
internal static partial class ArrayTests
{
[TestFixture]
public class AsReadOnlyTests
internal class AsReadOnlyTests
{
[Test]
public void AsReadOnly_ShouldReturnReadOnlyCollection_WhenArrayIsNotNull()

View File

@ -3,7 +3,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
public partial class ArrayTests
internal static partial class ArrayTests
{
[TestFixture]
public class ClearTests

View File

@ -3,6 +3,6 @@
namespace X10D.Tests.Collections;
[TestFixture]
public partial class ArrayTests
internal static partial class ArrayTests
{
}

View File

@ -4,7 +4,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class BoolListTests
internal class BoolListTests
{
[Test]
public void PackByte_Should_Pack_Correctly()

View File

@ -5,7 +5,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class ByteTests
internal class ByteTests
{
[Test]
public void Unpack_ShouldUnpackToArrayCorrectly()

View File

@ -5,7 +5,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
public partial class CollectionTests
internal partial class CollectionTests
{
[TestFixture]
public class ClearAndDisposeAllTests

View File

@ -5,7 +5,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
public partial class CollectionTests
internal partial class CollectionTests
{
[TestFixture]
public class ClearAndDisposeAllAsyncTests

View File

@ -3,6 +3,6 @@
namespace X10D.Tests.Collections;
[TestFixture]
public partial class CollectionTests
internal partial class CollectionTests
{
}

View File

@ -4,7 +4,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class DictionaryTests
internal class DictionaryTests
{
[Test]
public void AddOrUpdate_ShouldAddNewKey_IfNotExists_GivenConcreteDictionary()

View File

@ -4,7 +4,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
public partial class EnumerableTests
internal partial class EnumerableTests
{
[TestFixture]
public class DisposeAllTests

View File

@ -4,7 +4,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
public partial class EnumerableTests
internal partial class EnumerableTests
{
[TestFixture]
public class DisposeAllAsyncTests

View File

@ -5,7 +5,7 @@ using X10D.Core;
namespace X10D.Tests.Collections;
[TestFixture]
public partial class EnumerableTests
internal partial class EnumerableTests
{
[Test]
public void CountWhereNot_ShouldReturnCorrectCount_GivenSequence()

View File

@ -5,7 +5,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class Int16Tests
internal class Int16Tests
{
[Test]
public void Unpack_ShouldUnpackToArrayCorrectly()

View File

@ -5,7 +5,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class Int32Tests
internal class Int32Tests
{
[Test]
public void Unpack_ShouldUnpackToArrayCorrectly()

View File

@ -1,11 +1,12 @@
using System.Diagnostics;
using System.Globalization;
using NUnit.Framework;
using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class Int64Tests
internal class Int64Tests
{
[Test]
public void UnpackBits_ShouldUnpackToArrayCorrectly()
@ -29,7 +30,7 @@ public class Int64Tests
for (var index = 8; index < 64; index++)
{
Assert.That(bits[index], Is.False, index.ToString());
Assert.That(bits[index], Is.False, index.ToString(CultureInfo.InvariantCulture));
}
});
}
@ -53,7 +54,7 @@ public class Int64Tests
for (var index = 8; index < 64; index++)
{
Assert.That(bits[index], Is.False, index.ToString());
Assert.That(bits[index], Is.False, index.ToString(CultureInfo.InvariantCulture));
}
});
}

View File

@ -4,10 +4,9 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class ListTests
internal class ListTests
{
[CLSCompliant(false)]
[Test]
[Test]
[TestCase(1)]
[TestCase(1, 2, 3)]
[TestCase(1, 2, 3, 4, 5)]
@ -26,8 +25,7 @@ public class ListTests
CollectionAssert.AreEqual(all42, list);
}
[CLSCompliant(false)]
[Test]
[Test]
[TestCase(1)]
[TestCase(1, 2, 3)]
[TestCase(1, 2, 3, 4, 5)]

View File

@ -4,7 +4,7 @@ using X10D.Collections;
namespace X10D.Tests.Collections;
[TestFixture]
public class SpanTest
internal class SpanTest
{
[Test]
public void Count_ShouldReturn0_GivenEmptySpan()

View File

@ -4,7 +4,7 @@ using X10D.Core;
namespace X10D.Tests.Core;
[TestFixture]
public class CoreTests
internal class CoreTests
{
[Test]
[TestCase(1)]

View File

@ -4,7 +4,7 @@ using X10D.Core;
namespace X10D.Tests.Core;
[TestFixture]
public class EnumTests
internal class EnumTests
{
// Microsoft wrongfully decided to have Sunday be 0, Monday be 1, etc.
// I personally hate this, Sunday is not the first day of the week.

View File

@ -7,7 +7,7 @@ using X10D.Core;
namespace X10D.Tests.Core;
[TestFixture]
public class IntrinsicTests
internal class IntrinsicTests
{
[Test]
public void CorrectBoolean_ShouldReturnExpectedVector64Result_GivenInputVector()

View File

@ -4,7 +4,7 @@ using X10D.Core;
namespace X10D.Tests.Core;
[TestFixture]
public class NullableTests
internal class NullableTests
{
[Test]
public void TryGetValue_ShouldBeTrue_GivenValue()

View File

@ -5,7 +5,7 @@ using X10D.Core;
namespace X10D.Tests.Core;
[TestFixture]
public class RandomTests
internal class RandomTests
{
[Test]
public void NextBoolean_ShouldBeFalse_GivenSeed1234()

View File

@ -8,7 +8,7 @@ using X10D.Core;
namespace X10D.Tests.Core;
[TestFixture]
public class SpanTest
internal class SpanTest
{
[Test]
public void Contains_ShouldReturnFalse_GivenReadOnlySpanWithNoMatchingElements_UsingByteEnum()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class CircleFTests
internal class CircleFTests
{
[Test]
public void Area_ShouldBePiRadiusRadius_GivenUnitCircle()

View File

@ -4,7 +4,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class CircleTests
internal class CircleTests
{
[Test]
public void Area_ShouldBePiRadiusRadius_GivenUnitCircle()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class ColorTests
internal class ColorTests
{
private static readonly Color Black = Color.FromArgb(0, 0, 0);
private static readonly Color White = Color.FromArgb(255, 255, 255);

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class CuboidTests
internal class CuboidTests
{
[Test]
public void Corners_ShouldBeCorrect_GivenCubeOfSize1()

View File

@ -6,7 +6,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class EllipseFTests
internal class EllipseFTests
{
[Test]
public void Area_ShouldBePiRadiusRadius_GivenUnitEllipse()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class EllipseTests
internal class EllipseTests
{
[Test]
public void Area_ShouldBePiRadiusRadius_GivenUnitEllipse()

View File

@ -6,7 +6,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class Line3DTests
internal class Line3DTests
{
[Test]
public void CompareTo_ShouldBeNegativeOne_GivenEmptyAndOne()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class LineFTests
internal class LineFTests
{
[Test]
public void CompareTo_ShouldBeNegativeOne_GivenEmptyAndOne()

View File

@ -4,7 +4,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class LineTests
internal class LineTests
{
[Test]
public void CompareTo_ShouldBeNegativeOne_GivenEmptyAndOne()

View File

@ -8,7 +8,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class PointFTests
internal class PointFTests
{
[Test]
public void IsOnLine_ShouldReturnTrue_GivenPointOnLine()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class PointTests
internal class PointTests
{
[Test]
public void IsOnLine_ShouldReturnTrue_GivenPointOnLine()

View File

@ -6,7 +6,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class PolygonFTests
internal class PolygonFTests
{
[Test]
public void AddVertices_ShouldAddVertices()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class PolygonTests
internal class PolygonTests
{
[Test]
public void AddVertices_ShouldAddVertices()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class PolyhedronTests
internal class PolyhedronTests
{
[Test]
public void AddVertices_ShouldAddVertices()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class RandomTests
internal class RandomTests
{
[Test]
public void NextColorArgb_ShouldReturn331515e5_GivenSeed1234()

View File

@ -5,7 +5,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class SizeTests
internal class SizeTests
{
[Test]
public void ToPoint_ShouldReturnPoint_WithEquivalentMembers()

View File

@ -4,7 +4,7 @@ using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestFixture]
public class SphereTests
internal class SphereTests
{
[Test]
public void Circumference_ShouldBe2PiRadius_GivenUnitCircle()

View File

@ -6,7 +6,7 @@ using X10D.Hosting.DependencyInjection;
namespace X10D.Tests.Hosting;
[TestFixture]
public class ServiceCollectionTests
internal class ServiceCollectionTests
{
[Test]
public void AddHostedSingleton_ShouldRegisterServiceAsSingletonAndAsHostedService()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class BooleanTests
internal class BooleanTests
{
[Test]
public void GetBytes_ReturnsArrayContaining1()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class ByteTests
internal class ByteTests
{
[Test]
public void GetBytes_ReturnsArrayContainingItself()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class DirectoryInfoTests
internal class DirectoryInfoTests
{
[Test]
public void Clear_ShouldClear_GivenValidDirectory()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class DoubleTests
internal class DoubleTests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class FileInfoTests
internal class FileInfoTests
{
[Test]
public void GetHashSha1ShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class Int16Tests
internal class Int16Tests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class Int32Tests
internal class Int32Tests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class Int64Tests
internal class Int64Tests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class ListOfByteTests
internal class ListOfByteTests
{
[Test]
public void AsString_ShouldReturnBytes_GivenBytes()

View File

@ -4,8 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
[CLSCompliant(false)]
public class SByteTests
internal class SByteTests
{
[Test]
public void GetBytes_ReturnsArrayContainingItself()

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class SingleTests
internal class SingleTests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void ReadDecimal_ShouldThrowArgumentException_GivenNonReadableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void ReadDouble_ShouldThrowArgumentException_GivenNonReadableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void ReadInt16_ShouldThrowArgumentException_GivenNonReadableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void ReadInt32_ShouldThrowArgumentException_GivenNonReadableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void ReadInt64_ShouldThrowArgumentException_GivenNonReadableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void ReadSingle_ShouldThrowArgumentException_GivenNonReadableStream()

View File

@ -3,11 +3,10 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
[CLSCompliant(false)]
public void ReadUInt16_ShouldThrowArgumentException_GivenNonReadableStream()
public void ReadUInt16_ShouldThrowArgumentException_GivenNonReadableStream()
{
Stream stream = new DummyStream();
Assert.Throws<ArgumentException>(() => stream.ReadUInt16());
@ -16,8 +15,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt16_ShouldThrowArgumentNullException_GivenNullStream()
public void ReadUInt16_ShouldThrowArgumentNullException_GivenNullStream()
{
Stream stream = null!;
Assert.Throws<ArgumentNullException>(() => stream.ReadUInt16());
@ -26,8 +24,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt16_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
public void ReadUInt16_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
{
// we don't need to enclose this stream in a using declaration, since disposing a
// null stream is meaningless. NullStream.Dispose actually does nothing, anyway.
@ -39,8 +36,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt16_ShouldReadBigEndian_GivenBigEndian()
public void ReadUInt16_ShouldReadBigEndian_GivenBigEndian()
{
using var stream = new MemoryStream();
ReadOnlySpan<byte> bytes = stackalloc byte[] {0x01, 0xA4};
@ -55,8 +51,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt16_ShouldReadLittleEndian_GivenLittleEndian()
public void ReadUInt16_ShouldReadLittleEndian_GivenLittleEndian()
{
using var stream = new MemoryStream();
ReadOnlySpan<byte> bytes = stackalloc byte[] {0xA4, 0x01};

View File

@ -3,11 +3,10 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
[CLSCompliant(false)]
public void ReadUInt32_ShouldThrowArgumentException_GivenNonReadableStream()
public void ReadUInt32_ShouldThrowArgumentException_GivenNonReadableStream()
{
Stream stream = new DummyStream();
Assert.Throws<ArgumentException>(() => stream.ReadUInt32());
@ -16,8 +15,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt32_ShouldThrowArgumentNullException_GivenNullStream()
public void ReadUInt32_ShouldThrowArgumentNullException_GivenNullStream()
{
Stream stream = null!;
Assert.Throws<ArgumentNullException>(() => stream.ReadUInt32());
@ -26,8 +24,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt32_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
public void ReadUInt32_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
{
// we don't need to enclose this stream in a using declaration, since disposing a
// null stream is meaningless. NullStream.Dispose actually does nothing, anyway.
@ -39,8 +36,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt32_ShouldReadBigEndian_GivenBigEndian()
public void ReadUInt32_ShouldReadBigEndian_GivenBigEndian()
{
using var stream = new MemoryStream();
ReadOnlySpan<byte> bytes = stackalloc byte[] {0x00, 0x00, 0x01, 0xA4};
@ -55,8 +51,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt32_ShouldReadLittleEndian_GivenLittleEndian()
public void ReadUInt32_ShouldReadLittleEndian_GivenLittleEndian()
{
using var stream = new MemoryStream();
ReadOnlySpan<byte> bytes = stackalloc byte[] {0xA4, 0x01, 0x00, 0x00};

View File

@ -3,11 +3,10 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
[CLSCompliant(false)]
public void ReadUInt64_ShouldThrowArgumentException_GivenNonReadableStream()
public void ReadUInt64_ShouldThrowArgumentException_GivenNonReadableStream()
{
Stream stream = new DummyStream();
Assert.Throws<ArgumentException>(() => stream.ReadUInt64());
@ -16,8 +15,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt64_ShouldThrowArgumentNullException_GivenNullStream()
public void ReadUInt64_ShouldThrowArgumentNullException_GivenNullStream()
{
Stream stream = null!;
Assert.Throws<ArgumentNullException>(() => stream.ReadUInt64());
@ -26,8 +24,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt64_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
public void ReadUInt64_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
{
// we don't need to enclose this stream in a using declaration, since disposing a
// null stream is meaningless. NullStream.Dispose actually does nothing, anyway.
@ -39,8 +36,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt64_ShouldReadBigEndian_GivenBigEndian()
public void ReadUInt64_ShouldReadBigEndian_GivenBigEndian()
{
using var stream = new MemoryStream();
ReadOnlySpan<byte> bytes = stackalloc byte[] {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xA4};
@ -55,8 +51,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void ReadUInt64_ShouldWriteLittleEndian_GivenLittleEndian()
public void ReadUInt64_ShouldWriteLittleEndian_GivenLittleEndian()
{
using var stream = new MemoryStream();
ReadOnlySpan<byte> bytes = stackalloc byte[] {0xA4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -4,7 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void WriteDecimal_ShouldThrowArgumentException_GivenNonWriteableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void WriteDouble_ShouldThrowArgumentException_GivenNonWriteableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void WriteInt16_ShouldThrowArgumentException_GivenNonWriteableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void WriteInt32_ShouldThrowArgumentException_GivenNonWriteableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void WriteInt64_ShouldThrowArgumentException_GivenNonWriteableStream()

View File

@ -3,7 +3,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void WriteSingle_ShouldThrowArgumentException_GivenNonWriteableStream()

View File

@ -3,11 +3,10 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
[CLSCompliant(false)]
public void WriteUInt16_ShouldThrowArgumentException_GivenNonWriteableStream()
public void WriteUInt16_ShouldThrowArgumentException_GivenNonWriteableStream()
{
Stream stream = new DummyStream();
Assert.Throws<ArgumentException>(() => stream.Write((ushort)420, Endianness.LittleEndian));
@ -15,8 +14,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt16_ShouldThrowArgumentNullException_GivenNullStream()
public void WriteUInt16_ShouldThrowArgumentNullException_GivenNullStream()
{
Stream stream = null!;
Assert.Throws<ArgumentNullException>(() => stream.Write((ushort)420, Endianness.LittleEndian));
@ -24,8 +22,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt16_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
public void WriteUInt16_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
{
// we don't need to enclose this stream in a using declaration, since disposing a
// null stream is meaningless. NullStream.Dispose actually does nothing, anyway.
@ -38,8 +35,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt16_ShouldWriteBigEndian_GivenBigEndian()
public void WriteUInt16_ShouldWriteBigEndian_GivenBigEndian()
{
using var stream = new MemoryStream();
stream.Write((ushort)420, Endianness.BigEndian);
@ -55,8 +51,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt16_ShouldWriteLittleEndian_GivenLittleEndian()
public void WriteUInt16_ShouldWriteLittleEndian_GivenLittleEndian()
{
using var stream = new MemoryStream();
stream.Write((ushort)420, Endianness.LittleEndian);

View File

@ -3,11 +3,10 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
[CLSCompliant(false)]
public void WriteUInt32_ShouldThrowArgumentException_GivenNonWriteableStream()
public void WriteUInt32_ShouldThrowArgumentException_GivenNonWriteableStream()
{
Stream stream = new DummyStream();
Assert.Throws<ArgumentException>(() => stream.Write(420U, Endianness.LittleEndian));
@ -15,8 +14,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt32_ShouldThrowArgumentNullException_GivenNullStream()
public void WriteUInt32_ShouldThrowArgumentNullException_GivenNullStream()
{
Stream stream = null!;
Assert.Throws<ArgumentNullException>(() => stream.Write(420U, Endianness.LittleEndian));
@ -24,8 +22,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt32_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
public void WriteUInt32_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
{
// we don't need to enclose this stream in a using declaration, since disposing a
// null stream is meaningless. NullStream.Dispose actually does nothing, anyway.
@ -38,8 +35,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt32_ShouldWriteBigEndian_GivenBigEndian()
public void WriteUInt32_ShouldWriteBigEndian_GivenBigEndian()
{
using var stream = new MemoryStream();
stream.Write(420U, Endianness.BigEndian);
@ -55,8 +51,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt32_ShouldWriteLittleEndian_GivenLittleEndian()
public void WriteUInt32_ShouldWriteLittleEndian_GivenLittleEndian()
{
using var stream = new MemoryStream();
stream.Write(420U, Endianness.LittleEndian);

View File

@ -3,11 +3,10 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class StreamTests
internal partial class StreamTests
{
[Test]
[CLSCompliant(false)]
public void WriteUInt64_ShouldThrowArgumentException_GivenNonWriteableStream()
public void WriteUInt64_ShouldThrowArgumentException_GivenNonWriteableStream()
{
Stream stream = new DummyStream();
Assert.Throws<ArgumentException>(() => stream.Write(420UL, Endianness.LittleEndian));
@ -15,8 +14,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt64_ShouldThrowArgumentNullException_GivenNullStream()
public void WriteUInt64_ShouldThrowArgumentNullException_GivenNullStream()
{
Stream stream = null!;
Assert.Throws<ArgumentNullException>(() => stream.Write(420UL, Endianness.LittleEndian));
@ -24,8 +22,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt64_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
public void WriteUInt64_ShouldThrowArgumentOutOfRangeException_GivenInvalidEndiannessValue()
{
// we don't need to enclose this stream in a using declaration, since disposing a
// null stream is meaningless. NullStream.Dispose actually does nothing, anyway.
@ -38,8 +35,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt64_ShouldWriteBigEndian_GivenBigEndian()
public void WriteUInt64_ShouldWriteBigEndian_GivenBigEndian()
{
using var stream = new MemoryStream();
stream.Write(420UL, Endianness.BigEndian);
@ -55,8 +51,7 @@ public partial class StreamTests
}
[Test]
[CLSCompliant(false)]
public void WriteUInt64_ShouldWriteLittleEndian_GivenLittleEndian()
public void WriteUInt64_ShouldWriteLittleEndian_GivenLittleEndian()
{
using var stream = new MemoryStream();
stream.Write(420UL, Endianness.LittleEndian);

View File

@ -7,7 +7,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public partial class StreamTests
internal partial class StreamTests
{
[Test]
public void GetHashSha1ShouldBeCorrect()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
public class TextReaderTests
internal class TextReaderTests
{
[Test]
public void EnumerateLines_ShouldYield10Lines_Given10LineString()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class TextWriterTests
internal partial class TextWriterTests
{
[Test]
public void WriteNoAlloc_ShouldThrowArgumentNullException_GivenDouble_AndNullWriter()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class TextWriterTests
internal partial class TextWriterTests
{
[Test]
public void WriteNoAlloc_ShouldThrowArgumentNullException_GivenInt32_AndNullWriter()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class TextWriterTests
internal partial class TextWriterTests
{
[Test]
public void WriteNoAlloc_ShouldThrowArgumentNullException_GivenInt64_AndNullWriter()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class TextWriterTests
internal partial class TextWriterTests
{
[Test]
public void WriteNoAlloc_ShouldThrowArgumentNullException_GivenSingle_AndNullWriter()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class TextWriterTests
internal partial class TextWriterTests
{
[Test]
public void WriteNoAlloc_ShouldThrowArgumentNullException_GivenUInt32_AndNullWriter()

View File

@ -5,7 +5,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
public partial class TextWriterTests
internal partial class TextWriterTests
{
[Test]
public void WriteNoAlloc_ShouldThrowArgumentNullException_GivenUInt64_AndNullWriter()

View File

@ -1,11 +1,13 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using NUnit.Framework;
namespace X10D.Tests.IO;
[TestFixture]
public partial class TextWriterTests
[SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable")]
internal partial class TextWriterTests
{
private MemoryStream _stream = null!;
private StreamWriter _writer = null!;

View File

@ -4,8 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
[CLSCompliant(false)]
public class UInt16Tests
internal class UInt16Tests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -4,8 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
[CLSCompliant(false)]
public class UInt32Tests
internal class UInt32Tests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -4,8 +4,7 @@ using X10D.IO;
namespace X10D.Tests.IO;
[TestFixture]
[CLSCompliant(false)]
public class UInt64Tests
internal class UInt64Tests
{
[Test]
public void GetBytes_ReturnsCorrectValue()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class ByteTests
internal class ByteTests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class DecimalTests
internal class DecimalTests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class DoubleTests
internal class DoubleTests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class EnumerableTests
internal class EnumerableTests
{
[Test]
public void Except_ShouldFilterElements_GivenMatchingElements()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class Int16Tests
internal class Int16Tests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class Int32Tests
internal class Int32Tests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class Int64Tests
internal class Int64Tests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class ReadOnlySpanTests
internal class ReadOnlySpanTests
{
[Test]
public void AllShouldReturnTrueForEmptySpan()

View File

@ -4,8 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
[CLSCompliant(false)]
public class SByteTests
internal class SByteTests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class SingleTests
internal class SingleTests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,7 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
public class SpanTests
internal class SpanTests
{
[Test]
public void AllShouldReturnTrueForEmptySpan()

View File

@ -4,8 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
[CLSCompliant(false)]
public class UInt16Tests
internal class UInt16Tests
{
[Test]
public void ProductShouldBeCorrect()

View File

@ -4,8 +4,7 @@ using X10D.Linq;
namespace X10D.Tests.Linq;
[TestFixture]
[CLSCompliant(false)]
public class UInt32Tests
internal class UInt32Tests
{
[Test]
public void ProductShouldBeCorrect()

Some files were not shown because too many files have changed in this diff Show More