1
0

Adding support for .NET 8.0 LTS, renaming private fields to start with underscore

This commit is contained in:
2023-12-29 01:58:40 +01:00
parent 8bd511a936
commit 99d3f7758a
59 changed files with 922 additions and 871 deletions

View File

@@ -12,7 +12,7 @@ namespace UnitTests.Common.Extensions
{
// arrange
string str = "Hello World!";
byte[] bytes = new byte[] { 0xaf, 0xfe };
byte[] bytes = [0xaf, 0xfe];
// act
string strHash = str.Md5();
@@ -28,7 +28,7 @@ namespace UnitTests.Common.Extensions
{
// arrange
string str = "Hello World!";
byte[] bytes = new byte[] { 0xaf, 0xfe };
byte[] bytes = [0xaf, 0xfe];
// act
string strHash = str.Sha1();
@@ -44,7 +44,7 @@ namespace UnitTests.Common.Extensions
{
// arrange
string str = "Hello World!";
byte[] bytes = new byte[] { 0xaf, 0xfe };
byte[] bytes = [0xaf, 0xfe];
// act
string strHash = str.Sha256();
@@ -60,7 +60,7 @@ namespace UnitTests.Common.Extensions
{
// arrange
string str = "Hello World!";
byte[] bytes = new byte[] { 0xaf, 0xfe };
byte[] bytes = [0xaf, 0xfe];
// act
string strHash = str.Sha512();

View File

@@ -56,11 +56,11 @@ namespace UnitTests.Common.Extensions
// arrange
var innerExceptions = new List<Exception>
{
new Exception("Inner Exception 1."),
new Exception("Inner Exception 2. See the inner exception for details.", new Exception("Inner Exception of Exception 2.")),
new Exception("Inner Exception 3."),
new Exception("Inner Exception 4."),
new Exception("Inner Exception 5.")
new("Inner Exception 1."),
new("Inner Exception 2. See the inner exception for details.", new Exception("Inner Exception of Exception 2.")),
new("Inner Exception 3."),
new("Inner Exception 4."),
new("Inner Exception 5.")
};
var aggregateException = new AggregateException("Lots of exceptions.", innerExceptions);
string expectedMessage = "Inner Exception 1. Inner Exception 2. Inner Exception of Exception 2. Inner Exception 3.";

View File

@@ -224,7 +224,7 @@ namespace UnitTests.Common.Extensions
public void ShouldConvertToJArray()
{
// arrange
string[] stringArray = new[] { "one", "two", "three" };
string[] stringArray = ["one", "two", "three"];
var objectArray = new[]
{
new JsonTestClass { StringValue = "One" },

View File

@@ -154,7 +154,7 @@ namespace UnitTests.Common.Extensions
catch (Exception)
{ /* keep it quiet */ }
});
Task.WaitAll(awaitableTask);
awaitableTask.Wait();
// assert
Assert.IsTrue(isTimeout);
@@ -183,7 +183,7 @@ namespace UnitTests.Common.Extensions
catch (Exception)
{ /* keep it quiet */ }
});
Task.WaitAll(awaitableTask);
awaitableTask.Wait();
// assert
Assert.IsTrue(isTimeout);
@@ -212,7 +212,7 @@ namespace UnitTests.Common.Extensions
catch (Exception)
{ /* keep it quiet */ }
});
Task.WaitAll(awaitableTask);
awaitableTask.Wait();
// assert
Assert.IsTrue(isTimeout);

View File

@@ -87,7 +87,7 @@ namespace UnitTests.Common.Extensions
{
// arrange
byte[] bytes1 = null;
byte[] bytes2 = Array.Empty<byte>();
byte[] bytes2 = [];
// act
string hex1 = bytes1.BytesToHex();
@@ -102,7 +102,7 @@ namespace UnitTests.Common.Extensions
public void ShouldReturnHexString()
{
// arrange
byte[] bytes = new byte[] { 0xaf, 0xfe };
byte[] bytes = [0xaf, 0xfe];
// act
string hex = bytes.BytesToHex();
@@ -116,7 +116,7 @@ namespace UnitTests.Common.Extensions
public void ShouldReturnHexStringWithDelimiter()
{
// arrange
byte[] bytes = new byte[] { 0xde, 0xad, 0xbe, 0xef };
byte[] bytes = [0xde, 0xad, 0xbe, 0xef];
// act
string hex = bytes.BytesToHex("_");