implement initialize pattern
This commit is contained in:
Родитель
a8974174f9
Коммит
bc17ba6e45
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>2.0.1</Version>
|
||||
<Version>2.1.0</Version>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
<PackageTags>MassTransit, Verify</PackageTags>
|
||||
<Description>Adds Verify (https://github.com/VerifyTests/Verify) support to verify MassTransit test helpers (https://masstransit-project.com/usage/testing.html).</Description>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
[ModuleInitializer]
|
||||
public static void Initialize() =>
|
||||
VerifyMassTransit.Enable();
|
||||
VerifyMassTransit.Initialize();
|
||||
|
||||
#endregion
|
||||
|
||||
[ModuleInitializer]
|
||||
public static void InitializeOther() =>
|
||||
VerifyDiffPlex.Initialize();
|
||||
VerifierSettings.InitializePlugins();
|
||||
}
|
|
@ -2,8 +2,21 @@
|
|||
|
||||
public static class VerifyMassTransit
|
||||
{
|
||||
public static void Enable()
|
||||
public static bool Initialized { get; private set; }
|
||||
|
||||
[Obsolete("Use Initialize()")]
|
||||
public static void Enable() =>
|
||||
Initialize();
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (Initialized)
|
||||
{
|
||||
throw new("Already Initialized");
|
||||
}
|
||||
|
||||
Initialized = true;
|
||||
|
||||
InnerVerifier.ThrowIfVerifyHasBeenRun();
|
||||
VerifierSettings.AddExtraSettings(serializerSettings =>
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче