1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:38:47 +00:00

[ci skip] Use file-scoped namespaces for tests

This commit is contained in:
Oliver Booth 2022-04-21 12:15:29 +01:00
parent 6f96ab795c
commit 4855ae8bf2
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
8 changed files with 665 additions and 673 deletions

View File

@ -1,13 +1,13 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="BooleanExtensions" />.
/// </summary>
[TestClass]
public class BooleanTests
{
/// <summary>
/// Tests for <see cref="BooleanExtensions" />.
/// </summary>
[TestClass]
public class BooleanTests
{
/// <summary>
/// Tests <see cref="BooleanExtensions.GetBytes" />.
/// </summary>
@ -29,5 +29,4 @@ namespace X10D.Tests.Core
CollectionAssert.AreEqual(trueBytes, trueResult);
CollectionAssert.AreEqual(falseBytes, falseResult);
}
}
}

View File

@ -1,13 +1,13 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="ByteExtensions" />
/// </summary>
[TestClass]
public class ByteTests
{
/// <summary>
/// Tests for <see cref="ByteExtensions" />
/// </summary>
[TestClass]
public class ByteTests
{
/// <summary>
/// Tests <see cref="ByteExtensions.GetBytes" />.
/// </summary>
@ -58,5 +58,4 @@ namespace X10D.Tests.Core
Assert.IsTrue(oneOdd);
Assert.IsFalse(twoOdd);
}
}
}

View File

@ -1,13 +1,13 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="CharExtensions" />.
/// </summary>
[TestClass]
public class CharTests
{
/// <summary>
/// Tests for <see cref="CharExtensions" />.
/// </summary>
[TestClass]
public class CharTests
{
[TestMethod]
public void Repeat()
{
@ -20,5 +20,4 @@ namespace X10D.Tests.Core
Assert.AreEqual(repeated, result);
Assert.ThrowsException<ArgumentOutOfRangeException>(() => character.Repeat(-1));
}
}
}

View File

@ -1,13 +1,13 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="ComparableExtensions" />.
/// </summary>
[TestClass]
public class ComparableTests
{
/// <summary>
/// Tests for <see cref="ComparableExtensions" />.
/// </summary>
[TestClass]
public class ComparableTests
{
/// <summary>
/// Tests <see cref="ComparableExtensions.Between{T1, T2, T3}" />
/// </summary>
@ -127,5 +127,4 @@ namespace X10D.Tests.Core
Assert.AreEqual(first, first.Min(second));
Assert.AreEqual(first, second.Min(first));
}
}
}

View File

@ -1,16 +1,16 @@
using System.Diagnostics;
namespace X10D.Tests.Core
{
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="DoubleExtensions" />.
/// </summary>
[TestClass]
public class DoubleTests
{
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
/// <summary>
/// Tests for <see cref="DoubleExtensions" />.
/// </summary>
[TestClass]
public class DoubleTests
{
/// <summary>
/// Test for <see cref="DoubleExtensions.LerpTo" />
/// </summary>
@ -102,5 +102,4 @@ namespace X10D.Tests.Core
Assert.AreEqual(5.0, 7.0.Round(5));
Assert.AreEqual(10.0, 7.5.Round(5));
}
}
}

View File

@ -3,21 +3,21 @@ using System.Reflection;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="Int32Extensions.IsPrime(int)"/>.
/// </summary>
/// <remarks>
/// Tests for this extension method are delegated to their own test class because of the non-trivial requirements for
/// loading testing prime numbers.
/// </remarks>
/// <seealso cref="Int16Extensions.IsPrime(short)" />
/// <seealso cref="Int32Extensions.IsPrime(int)" />
/// <seealso cref="Int64Extensions.IsPrime(long)" />
[TestClass]
public class IsPrimeTests
{
/// <summary>
/// Tests for <see cref="Int32Extensions.IsPrime(int)"/>.
/// </summary>
/// <remarks>
/// Tests for this extension method are delegated to their own test class because of the non-trivial requirements for
/// loading testing prime numbers.
/// </remarks>
/// <seealso cref="Int16Extensions.IsPrime(short)" />
/// <seealso cref="Int32Extensions.IsPrime(int)" />
/// <seealso cref="Int64Extensions.IsPrime(long)" />
[TestClass]
public class IsPrimeTests
{
private IReadOnlyList<int> _primeNumbers = ArraySegment<int>.Empty;
[TestInitialize]
@ -115,5 +115,4 @@ namespace X10D.Tests.Core
return primes.AsReadOnly();
}
}
}

View File

@ -1,14 +1,14 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="SByteExtensions" />
/// </summary>
[CLSCompliant(false)]
[TestClass]
public class SByteTests
{
/// <summary>
/// Tests for <see cref="SByteExtensions" />
/// </summary>
[CLSCompliant(false)]
[TestClass]
public class SByteTests
{
/// <summary>
/// Tests <see cref="SByteExtensions.IsEven"/>.
/// </summary>
@ -40,5 +40,4 @@ namespace X10D.Tests.Core
Assert.AreEqual(true, oneOdd);
Assert.AreEqual(false, twoOdd);
}
}
}

View File

@ -1,13 +1,13 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace X10D.Tests.Core
namespace X10D.Tests.Core;
/// <summary>
/// Tests for <see cref="StringExtensions" />.
/// </summary>
[TestClass]
public class StringTests
{
/// <summary>
/// Tests for <see cref="StringExtensions" />.
/// </summary>
[TestClass]
public class StringTests
{
/// <summary>
/// Tests <see cref="StringExtensions.AsNullIfEmpty" />.
/// </summary>
@ -232,5 +232,4 @@ namespace X10D.Tests.Core
Assert.AreEqual(alternative, ((string?)null).WithEmptyAlternative(alternative));
Assert.AreEqual(alternative, ((string?)null).WithWhiteSpaceAlternative(alternative));
}
}
}