1
0

Moved all UnitTests to a single project. Implemented parts of AspNetCore UnitTests.

This commit is contained in:
2022-07-17 12:21:05 +02:00
parent 73038bbe5a
commit a26d6a0036
46 changed files with 2411 additions and 105 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Security.Cryptography;
using ReflectionMagic;
namespace UnitTests.Common.Utils
{
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal class CryptographyHelperSaltMock : IDisposable
{
private readonly int saltLength;
private CryptographyHelperSaltMock(int saltLength)
{
this.saltLength = typeof(CryptographyHelper).AsDynamicType().saltLength;
SetSaltLength(saltLength);
}
public static IDisposable Create(int saltLength)
=> new CryptographyHelperSaltMock(saltLength);
public void Dispose()
=> SetSaltLength(saltLength);
private static void SetSaltLength(int length)
=> typeof(CryptographyHelper).AsDynamicType().saltLength = length;
}
}