From ee094bcd154a93491e8d0d1cec1ec66abcbb8366 Mon Sep 17 00:00:00 2001
From: David C <35226978+dav1dev@users.noreply.github.com>
Date: Thu, 19 Aug 2021 17:57:47 +0200
Subject: [PATCH 1/2] Support .NET Standard 2.0
Targets .NET Standard now.
* converted project files to new sdk format
* removed package reference to fundamentals, replace ensure with copy of guard. remove ensure in sample project.
* removed assembly info and embed package data in project file
* removed old references
* added analyzer rulesets
* migrated test syntax from machine specifications to pure xunit
* updated to net standard 2.0 / net4.8
* removed reference includes in test projects
* updated packages
* updated readme
---
.gitignore | 3 +-
README.md | 6 +-
source/Analyzers.Facts.ruleset | 44 +++
source/Analyzers.Productive.ruleset | 48 ++++
source/Analyzers.Specs.ruleset | 49 ++++
.../AbstractStrategyTest.cs | 10 +-
.../Appccelerate.Bootstrapper.Facts.csproj | 160 ++---------
.../Behavior/DisposeExtensionBehaviorTest.cs | 2 +-
.../DefaultBootstrapperTest.cs | 8 +-
.../Execution/ExecutorTest.cs | 10 +-
.../Formatters/TypeExtensionsFacts.cs} | 37 +--
.../NuGet.config | 6 -
.../Properties/AssemblyInfo.cs | 25 --
.../Properties/GlobalAssemblyInfo.cs | 34 ---
.../Settings.stylecop | 70 -----
.../Syntax/Executables/ExecutableTest.cs | 8 +-
.../Syntax/SyntaxBuilderTest.cs | 8 +-
.../packages.config | 14 -
.../Appccelerate.Bootstrapper.Sample.csproj | 134 ++--------
.../ExtensionWhichRegistersSomething.cs | 2 -
...ExtensionWithCustomConfigurationSection.cs | 3 -
.../Customization/AsynchronousRunExecutor.cs | 2 -
.../AsynchronousShutdownExecutor.cs | 2 -
.../Customization/CustomExtensionResolver.cs | 2 -
.../Customization/DecoratingExecutable.cs | 2 -
.../NuGet.config | 6 -
.../Properties/AssemblyInfo.cs | 25 --
.../Properties/GlobalAssemblyInfo.cs | 34 ---
.../Settings.stylecop | 112 --------
.../packages.config | 11 -
.../Appccelerate.Bootstrapper.Specs.csproj | 161 ++---------
.../BootstrapperReportingSpecification.cs | 92 -------
.../BootstrapperSpecification.cs | 46 ----
.../BootstrapperWithBehaviorSpecification.cs | 49 ----
...nfigurationSectionBehaviorSpecification.cs | 39 ---
.../Dummies/Behavior.cs | 8 +-
.../BehaviorWithConfigurationContext.cs | 8 +-
.../NuGet.config | 6 -
.../Properties/AssemblyInfo.cs | 25 --
.../Properties/GlobalAssemblyInfo.cs | 34 ---
.../Settings.stylecop | 100 -------
.../packages.config | 14 -
.../when_the_bootstrapper_is_run.cs | 95 ++++---
...tstrapper_is_run_with_behavior_attached.cs | 141 +++++-----
...r_and_extension_with_customized_loading.cs | 65 +++--
...r_and_extension_with_customized_loading.cs | 91 ++++---
.../when_the_bootstrapper_is_shutdown.cs | 85 +++---
...pper_is_shutdown_with_behavior_attached.cs | 134 +++++-----
...n_the_bootstrapping_process_is_reported.cs | 252 ++++++++++++------
.../Appccelerate.Bootstrapper.csproj | 217 ++++++---------
.../Behavior/LazyBehavior.cs | 2 +-
.../ConfigurationSectionBehavior.cs | 10 +-
.../ExtensionConfigurationSectionBehavior.cs | 4 +-
.../Internals/AssignExtensionProperties.cs | 8 +-
.../Internals/DefaultConversionCallback.cs | 2 +-
.../Internals/HaveConfigurationSectionName.cs | 2 +-
.../ReflectExtensionPublicProperties.cs | 2 +-
.../DefaultBootstrapper.cs | 2 +-
.../Execution/SynchronousExecutor.cs | 4 +-
.../Execution/SynchronousReverseExecutor.cs | 4 +-
.../Formatters/TypeExtensions.cs | 50 ++++
source/Appccelerate.Bootstrapper/Guard.cs | 114 ++++++++
source/Appccelerate.Bootstrapper/NuGet.config | 6 -
.../Properties/AssemblyInfo.cs | 25 --
.../Properties/GlobalAssemblyInfo.cs | 34 ---
.../Reporting/BehaviorContext.cs | 2 +-
.../Reporting/ExecutableContext.cs | 2 +-
.../Reporting/ExecutionContext.cs | 2 +-
.../Reporting/ExtensionContext.cs | 2 +-
.../Settings.stylecop | 116 --------
.../Syntax/Executables/ActionExecutable.cs | 4 +-
.../ActionOnExtensionExecutable.cs | 6 +-
...ionOnExtensionWithInitializerExecutable.cs | 6 +-
.../Syntax/SyntaxBuilderWithContext.cs | 2 +-
.../appccelerate.bootstrapper.nuspec | 44 ---
source/Appccelerate.Bootstrapper/icon.png | Bin 0 -> 7860 bytes
.../Appccelerate.Bootstrapper/packages.config | 11 -
77 files changed, 1035 insertions(+), 1970 deletions(-)
create mode 100644 source/Analyzers.Facts.ruleset
create mode 100644 source/Analyzers.Productive.ruleset
create mode 100644 source/Analyzers.Specs.ruleset
rename source/{Appccelerate.Bootstrapper.Specs/BootstrapperWithConfigurationSectionBehaviorSpecification.cs => Appccelerate.Bootstrapper.Facts/Formatters/TypeExtensionsFacts.cs} (50%)
delete mode 100644 source/Appccelerate.Bootstrapper.Facts/NuGet.config
delete mode 100644 source/Appccelerate.Bootstrapper.Facts/Properties/AssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Facts/Properties/GlobalAssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Facts/Settings.stylecop
delete mode 100644 source/Appccelerate.Bootstrapper.Facts/packages.config
delete mode 100644 source/Appccelerate.Bootstrapper.Sample/NuGet.config
delete mode 100644 source/Appccelerate.Bootstrapper.Sample/Properties/AssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Sample/Properties/GlobalAssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Sample/Settings.stylecop
delete mode 100644 source/Appccelerate.Bootstrapper.Sample/packages.config
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/BootstrapperReportingSpecification.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/BootstrapperSpecification.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/BootstrapperWithBehaviorSpecification.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/BootstrapperWithExtensionConfigurationSectionBehaviorSpecification.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/NuGet.config
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/Properties/AssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/Properties/GlobalAssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/Settings.stylecop
delete mode 100644 source/Appccelerate.Bootstrapper.Specs/packages.config
create mode 100644 source/Appccelerate.Bootstrapper/Formatters/TypeExtensions.cs
create mode 100644 source/Appccelerate.Bootstrapper/Guard.cs
delete mode 100644 source/Appccelerate.Bootstrapper/NuGet.config
delete mode 100644 source/Appccelerate.Bootstrapper/Properties/AssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper/Properties/GlobalAssemblyInfo.cs
delete mode 100644 source/Appccelerate.Bootstrapper/Settings.stylecop
delete mode 100644 source/Appccelerate.Bootstrapper/appccelerate.bootstrapper.nuspec
create mode 100644 source/Appccelerate.Bootstrapper/icon.png
delete mode 100644 source/Appccelerate.Bootstrapper/packages.config
diff --git a/.gitignore b/.gitignore
index 5c1d8a8..5291ba9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,4 +107,5 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
-Specs
\ No newline at end of file
+Specs
+source/.idea/.idea.Appccelerate.Bootstrapper/.idea/
diff --git a/README.md b/README.md
index c4a5e5d..b148d4d 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,5 @@
-Please see http://www.appccelerate.com/bootstrapper.html for documentation.
+# Appccelerate.Bootstrapper
+
+Every application goes through start up and shutdown phases. The bootstrapper provides you an approved and extendable mechanism for bootstrapping the software life cycle.
+
+Please see [appccelerate.github.io/bootstrapper](https://appccelerate.github.io/bootstrapper.html) for documentation.
diff --git a/source/Analyzers.Facts.ruleset b/source/Analyzers.Facts.ruleset
new file mode 100644
index 0000000..b17a65a
--- /dev/null
+++ b/source/Analyzers.Facts.ruleset
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/Analyzers.Productive.ruleset b/source/Analyzers.Productive.ruleset
new file mode 100644
index 0000000..040d8ee
--- /dev/null
+++ b/source/Analyzers.Productive.ruleset
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/Analyzers.Specs.ruleset b/source/Analyzers.Specs.ruleset
new file mode 100644
index 0000000..97a624d
--- /dev/null
+++ b/source/Analyzers.Specs.ruleset
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/Appccelerate.Bootstrapper.Facts/AbstractStrategyTest.cs b/source/Appccelerate.Bootstrapper.Facts/AbstractStrategyTest.cs
index 904eac8..efd0581 100644
--- a/source/Appccelerate.Bootstrapper.Facts/AbstractStrategyTest.cs
+++ b/source/Appccelerate.Bootstrapper.Facts/AbstractStrategyTest.cs
@@ -19,7 +19,6 @@
namespace Appccelerate.Bootstrapper
{
using System;
-
using Appccelerate.Bootstrapper.Execution;
using Appccelerate.Bootstrapper.Extension;
using Appccelerate.Bootstrapper.Reporting;
@@ -48,7 +47,7 @@ public void BuildRunSyntax_WhenCalledMultipleTimes_ShouldThrowException()
{
this.testee.BuildRunSyntax();
- this.testee.Invoking(x => x.BuildRunSyntax()).ShouldThrow();
+ this.testee.Invoking(x => x.BuildRunSyntax()).Should().Throw();
}
[Fact]
@@ -65,7 +64,7 @@ public void BuildShutdownSyntax_WhenCalledMultipleTimes_ShouldThrowException()
{
this.testee.BuildShutdownSyntax();
- this.testee.Invoking(x => x.BuildShutdownSyntax()).ShouldThrow();
+ this.testee.Invoking(x => x.BuildShutdownSyntax()).Should().Throw();
}
[Fact]
@@ -114,12 +113,13 @@ public void Dispose_MultipleTimes_ShouldNotThrow()
{
this.testee.Dispose();
- this.testee.Invoking(t => t.Dispose()).ShouldNotThrow();
+ this.testee.Invoking(t => t.Dispose()).Should().NotThrow();
}
private class TestableAbstractStrategy : AbstractStrategy
{
- public TestableAbstractStrategy(ISyntaxBuilder runSyntaxBuilder, ISyntaxBuilder shutdownSyntaxBuilder)
+ public TestableAbstractStrategy(ISyntaxBuilder runSyntaxBuilder,
+ ISyntaxBuilder shutdownSyntaxBuilder)
: base(runSyntaxBuilder, shutdownSyntaxBuilder)
{
}
diff --git a/source/Appccelerate.Bootstrapper.Facts/Appccelerate.Bootstrapper.Facts.csproj b/source/Appccelerate.Bootstrapper.Facts/Appccelerate.Bootstrapper.Facts.csproj
index 46f13e0..85af532 100644
--- a/source/Appccelerate.Bootstrapper.Facts/Appccelerate.Bootstrapper.Facts.csproj
+++ b/source/Appccelerate.Bootstrapper.Facts/Appccelerate.Bootstrapper.Facts.csproj
@@ -1,139 +1,37 @@
-
-
-
+
- Debug
- AnyCPU
- {E5D38B10-5386-4774-A5E1-4E30C99DD1BC}
- Library
- Properties
Appccelerate.Bootstrapper
- Appccelerate.Bootstrapper.Facts
- v4.5
- 512
- 4e36768d
+ net48
+ false
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+
+
+ Appccelerate.Bootstrapper.Facts
+ Copyright © 2008-2021
+ Appccelerate team
+ Appccelerate
+ Appccelerate.Bootstrapper
+
-
- ..\packages\Appccelerate.Fundamentals.2.8.0\lib\portable-windows8+net45\Appccelerate.Fundamentals.dll
-
-
- ..\packages\FakeItEasy.1.25.1\lib\net40\FakeItEasy.dll
-
-
- ..\packages\FluentAssertions.3.2.2\lib\net45\FluentAssertions.dll
-
-
- ..\packages\FluentAssertions.3.2.2\lib\net45\FluentAssertions.Core.dll
-
-
-
-
-
-
-
-
-
-
- ..\packages\xunit.1.9.2\lib\net20\xunit.dll
-
-
- ..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
-
-
+
-
-
- {8F1AEC30-49CF-482C-BC4E-281984487847}
- Appccelerate.Bootstrapper
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+ ../Analyzers.Facts.ruleset
+
+
diff --git a/source/Appccelerate.Bootstrapper.Facts/Behavior/DisposeExtensionBehaviorTest.cs b/source/Appccelerate.Bootstrapper.Facts/Behavior/DisposeExtensionBehaviorTest.cs
index 25feaf9..82323ef 100644
--- a/source/Appccelerate.Bootstrapper.Facts/Behavior/DisposeExtensionBehaviorTest.cs
+++ b/source/Appccelerate.Bootstrapper.Facts/Behavior/DisposeExtensionBehaviorTest.cs
@@ -43,7 +43,7 @@ public void Behave_ShouldDisposeDisposableExtensions()
this.testee.Behave(new List { notDisposableExtension, disposableExtension });
A.CallTo(() => notDisposableExtension.Dispose()).MustNotHaveHappened();
- A.CallTo(() => disposableExtension.Dispose()).MustHaveHappened(Repeated.Exactly.Once);
+ A.CallTo(() => disposableExtension.Dispose()).MustHaveHappenedOnceExactly();
}
[Fact]
diff --git a/source/Appccelerate.Bootstrapper.Facts/DefaultBootstrapperTest.cs b/source/Appccelerate.Bootstrapper.Facts/DefaultBootstrapperTest.cs
index 4ded0d5..608c576 100644
--- a/source/Appccelerate.Bootstrapper.Facts/DefaultBootstrapperTest.cs
+++ b/source/Appccelerate.Bootstrapper.Facts/DefaultBootstrapperTest.cs
@@ -59,7 +59,7 @@ public void Initialize_MultipleTimes_ShouldThrowException()
this.testee.Initialize(this.strategy);
- this.testee.Invoking(x => x.Initialize(A.Fake>())).ShouldThrow();
+ this.testee.Invoking(x => x.Initialize(A.Fake>())).Should().Throw();
}
[Fact]
@@ -75,7 +75,7 @@ public void Initialize_ShouldCreateReportingContext()
[Fact]
public void AddExtension_WhenNotInitialized_ShouldThrowInvalidOperationException()
{
- this.testee.Invoking(x => x.AddExtension(A.Fake())).ShouldThrow();
+ this.testee.Invoking(x => x.AddExtension(A.Fake())).Should().Throw();
}
[Fact]
@@ -152,7 +152,7 @@ public void Run_ShouldExecuteSyntaxAndExtensionsOnRunExecutor()
public void Run_ShouldThrowExceptionWhenNotInitialized()
{
this.testee.Invoking(t => t.Run())
- .ShouldThrow();
+ .Should().Throw();
}
[Fact]
@@ -195,7 +195,7 @@ public void Shutdown_ShouldExecuteSyntaxAndExtensionsOnShutdownExecutor()
public void Shutdown_ShouldThrowExceptionWhenNotInitialized()
{
this.testee.Invoking(t => t.Shutdown())
- .ShouldThrow();
+ .Should().Throw();
}
[Fact]
diff --git a/source/Appccelerate.Bootstrapper.Facts/Execution/ExecutorTest.cs b/source/Appccelerate.Bootstrapper.Facts/Execution/ExecutorTest.cs
index 1873a33..979a85a 100644
--- a/source/Appccelerate.Bootstrapper.Facts/Execution/ExecutorTest.cs
+++ b/source/Appccelerate.Bootstrapper.Facts/Execution/ExecutorTest.cs
@@ -16,6 +16,8 @@
//
//-------------------------------------------------------------------------------
+using Xunit;
+
namespace Appccelerate.Bootstrapper.Execution
{
using System.Collections.Generic;
@@ -58,7 +60,7 @@ public static IEnumerable