-
- Counter
-
-
-
-
- Fetch data
+
+ Search
-
- Business Search
+
+ Add Business
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Shared/NavMenu.razor.css b/src/Subjects/Presentation.Web.BlazorServer/Shared/NavMenu.razor.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/Shared/NavMenu.razor.css
rename to src/Subjects/Presentation.Web.BlazorServer/Shared/NavMenu.razor.css
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Shared/SurveyPrompt.razor b/src/Subjects/Presentation.Web.BlazorServer/Shared/SurveyPrompt.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/Shared/SurveyPrompt.razor
rename to src/Subjects/Presentation.Web.BlazorServer/Shared/SurveyPrompt.razor
diff --git a/src/Subjects/Presentation/Web.BlazorServer/_Imports.razor b/src/Subjects/Presentation.Web.BlazorServer/_Imports.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/_Imports.razor
rename to src/Subjects/Presentation.Web.BlazorServer/_Imports.razor
diff --git a/src/Subjects/Presentation/Web.BlazorServer/appsettings.Development.json b/src/Subjects/Presentation.Web.BlazorServer/appsettings.Development.json
similarity index 94%
rename from src/Subjects/Presentation/Web.BlazorServer/appsettings.Development.json
rename to src/Subjects/Presentation.Web.BlazorServer/appsettings.Development.json
index fd0596fd..a95971e6 100644
--- a/src/Subjects/Presentation/Web.BlazorServer/appsettings.Development.json
+++ b/src/Subjects/Presentation.Web.BlazorServer/appsettings.Development.json
@@ -6,6 +6,7 @@
"Microsoft.AspNetCore": "Warning"
}
},
+ "AllowedHosts": "*",
"AzureAd": {
"Instance": "https://GoodToCodeB2CDev.b2clogin.com/",
"Domain": "GoodToCodeB2CDev.onmicrosoft.com",
@@ -28,7 +29,7 @@
"Scope": "api://7cf20ddf-bc1b-423e-b516-43d386b31da5/.default",
"Url": "https://api-subjects-dev-001.azurewebsites.net"
}
- //"SubjectsClientSecret": "FROM_KEY_VAULT"
+ //"Subjects:ClientSecret": "FROM_KEY_VAULT"
//"ApplicationInsights": {
// "ConnectionString": "FROM_APP_SERVICE"
//}
diff --git a/src/Subjects/Presentation/Web.BlazorServer/appsettings.json b/src/Subjects/Presentation.Web.BlazorServer/appsettings.Local.json
similarity index 53%
rename from src/Subjects/Presentation/Web.BlazorServer/appsettings.json
rename to src/Subjects/Presentation.Web.BlazorServer/appsettings.Local.json
index 21bcc156..e21023c6 100644
--- a/src/Subjects/Presentation/Web.BlazorServer/appsettings.json
+++ b/src/Subjects/Presentation.Web.BlazorServer/appsettings.Local.json
@@ -1,4 +1,5 @@
{
+ "DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
@@ -17,5 +18,19 @@
"ResetPasswordPolicyId": "b2c_1_reset",
"EditProfilePolicyId": "b2c_1_edit_profile",
"EnablePiiLogging": true
+ },
+ "Azure": {
+ "UseKeyVault": true,
+ "KeyVaultUri": "https://kv-subjects-dev-001.vault.azure.net/"
+ },
+ "Subjects": {
+ "ClientId": "e5a3284b-9aa7-43ee-9dc5-e2aa0be1908a",
+ "TokenUrl": "https://login.microsoftonline.com/ad6529dd-8db1-4015-a53d-6ae395fc7e39/oauth2/v2.0/token",
+ "Scope": "api://7cf20ddf-bc1b-423e-b516-43d386b31da5/.default",
+ "Url": "https://localhost:7171"
}
-}
\ No newline at end of file
+ //"Subjects:ClientSecret": "FROM_KEY_VAULT"
+ //"ApplicationInsights": {
+ // "ConnectionString": "FROM_APP_SERVICE"
+ //}
+}
diff --git a/src/Subjects/Presentation.Web.BlazorServer/appsettings.json b/src/Subjects/Presentation.Web.BlazorServer/appsettings.json
new file mode 100644
index 00000000..1b2d3baf
--- /dev/null
+++ b/src/Subjects/Presentation.Web.BlazorServer/appsettings.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css.map b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css.map
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css.map
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/bootstrap/bootstrap.min.css.map
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/FONT-LICENSE b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/FONT-LICENSE
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/FONT-LICENSE
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/FONT-LICENSE
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/ICON-LICENSE b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/ICON-LICENSE
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/ICON-LICENSE
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/ICON-LICENSE
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/README.md b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/README.md
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/README.md
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/README.md
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/site.css b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/site.css
similarity index 96%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/site.css
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/site.css
index 96b05836..3cb57ea0 100644
--- a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/css/site.css
+++ b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/css/site.css
@@ -25,7 +25,14 @@ a, .btn-link {
.content {
padding-top: 1.1rem;
}
+/* Positioning */
+.center-screen {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+}
+/* Validation styles */
.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
diff --git a/src/Subjects/Specs/Application.Unit/storeicon.png b/src/Subjects/Presentation.Web.BlazorServer/wwwroot/favicon.png
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/storeicon.png
rename to src/Subjects/Presentation.Web.BlazorServer/wwwroot/favicon.png
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/.config/dotnet-tools.json b/src/Subjects/Presentation.Web.BlazorStatic/.config/dotnet-tools.json
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/.config/dotnet-tools.json
rename to src/Subjects/Presentation.Web.BlazorStatic/.config/dotnet-tools.json
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/App.razor b/src/Subjects/Presentation.Web.BlazorStatic/App.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/App.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/App.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Pages/Authentication.razor b/src/Subjects/Presentation.Web.BlazorStatic/Pages/Authentication.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Pages/Authentication.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Pages/Authentication.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Pages/Counter.razor b/src/Subjects/Presentation.Web.BlazorStatic/Pages/Counter.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Pages/Counter.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Pages/Counter.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Pages/FetchData.razor b/src/Subjects/Presentation.Web.BlazorStatic/Pages/FetchData.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Pages/FetchData.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Pages/FetchData.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Pages/Index.razor b/src/Subjects/Presentation.Web.BlazorStatic/Pages/Index.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Pages/Index.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Pages/Index.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Web.BlazorStatic.csproj b/src/Subjects/Presentation.Web.BlazorStatic/Presentation.Web.BlazorStatic.csproj
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Web.BlazorStatic.csproj
rename to src/Subjects/Presentation.Web.BlazorStatic/Presentation.Web.BlazorStatic.csproj
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Program.cs b/src/Subjects/Presentation.Web.BlazorStatic/Program.cs
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Program.cs
rename to src/Subjects/Presentation.Web.BlazorStatic/Program.cs
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Properties/serviceDependencies.json b/src/Subjects/Presentation.Web.BlazorStatic/Properties/serviceDependencies.json
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Properties/serviceDependencies.json
rename to src/Subjects/Presentation.Web.BlazorStatic/Properties/serviceDependencies.json
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Properties/serviceDependencies.local.json b/src/Subjects/Presentation.Web.BlazorStatic/Properties/serviceDependencies.local.json
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Properties/serviceDependencies.local.json
rename to src/Subjects/Presentation.Web.BlazorStatic/Properties/serviceDependencies.local.json
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/LoginDisplay.razor b/src/Subjects/Presentation.Web.BlazorStatic/Shared/LoginDisplay.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/LoginDisplay.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/LoginDisplay.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/MainLayout.razor b/src/Subjects/Presentation.Web.BlazorStatic/Shared/MainLayout.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/MainLayout.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/MainLayout.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/MainLayout.razor.css b/src/Subjects/Presentation.Web.BlazorStatic/Shared/MainLayout.razor.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/MainLayout.razor.css
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/MainLayout.razor.css
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/NavMenu.razor b/src/Subjects/Presentation.Web.BlazorStatic/Shared/NavMenu.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/NavMenu.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/NavMenu.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/NavMenu.razor.css b/src/Subjects/Presentation.Web.BlazorStatic/Shared/NavMenu.razor.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/NavMenu.razor.css
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/NavMenu.razor.css
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/RedirectToLogin.razor b/src/Subjects/Presentation.Web.BlazorStatic/Shared/RedirectToLogin.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/RedirectToLogin.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/RedirectToLogin.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/Shared/SurveyPrompt.razor b/src/Subjects/Presentation.Web.BlazorStatic/Shared/SurveyPrompt.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/Shared/SurveyPrompt.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/Shared/SurveyPrompt.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/_Imports.razor b/src/Subjects/Presentation.Web.BlazorStatic/_Imports.razor
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/_Imports.razor
rename to src/Subjects/Presentation.Web.BlazorStatic/_Imports.razor
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/appsettings.json b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/appsettings.json
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/appsettings.json
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/appsettings.json
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/app.css b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/app.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/app.css
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/app.css
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css.map b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css.map
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css.map
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/bootstrap/bootstrap.min.css.map
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/FONT-LICENSE b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/FONT-LICENSE
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/FONT-LICENSE
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/FONT-LICENSE
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/ICON-LICENSE b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/ICON-LICENSE
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/ICON-LICENSE
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/ICON-LICENSE
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/README.md b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/README.md
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/README.md
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/README.md
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.eot b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.otf b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.svg b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.woff b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
diff --git a/src/Subjects/Presentation/Web.BlazorServer/wwwroot/favicon.png b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/favicon.png
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorServer/wwwroot/favicon.png
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/favicon.png
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/icon-192.png b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/icon-192.png
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/icon-192.png
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/icon-192.png
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/icon-512.png b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/icon-512.png
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/icon-512.png
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/icon-512.png
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/index.html b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/index.html
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/index.html
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/index.html
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/manifest.json b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/manifest.json
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/manifest.json
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/manifest.json
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/sample-data/weather.json b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/sample-data/weather.json
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/sample-data/weather.json
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/sample-data/weather.json
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/service-worker.js b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/service-worker.js
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/service-worker.js
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/service-worker.js
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/service-worker.published.js b/src/Subjects/Presentation.Web.BlazorStatic/wwwroot/service-worker.published.js
similarity index 100%
rename from src/Subjects/Presentation/Web.BlazorStatic/wwwroot/service-worker.published.js
rename to src/Subjects/Presentation.Web.BlazorStatic/wwwroot/service-worker.published.js
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Data/BusinessService.cs b/src/Subjects/Presentation/Web.BlazorServer/Data/BusinessService.cs
deleted file mode 100644
index 6c0e4ace..00000000
--- a/src/Subjects/Presentation/Web.BlazorServer/Data/BusinessService.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using Goodtocode.Subjects.Domain;
-using System.Net;
-using System.Text.Json;
-
-namespace Goodtocode.Subjects.BlazorServer.Data;
-
-public class BusinessService
-{
- private IHttpClientFactory _clientFactory;
-
- public BusinessService(IHttpClientFactory clientFactory)
- {
- _clientFactory = clientFactory;
- }
-
- public async Task
GetBusinessAsync(Guid key)
- {
- var httpClient = _clientFactory.CreateClient("SubjectsApiClient");
- var response = await httpClient.GetAsync($"{httpClient.BaseAddress}/Business?key={key}&api-version=1");
- var business = new BusinessEntity();
- if (response.StatusCode != HttpStatusCode.NotFound)
- {
- response.EnsureSuccessStatusCode();
- business = JsonSerializer.Deserialize(response.Content.ReadAsStream());
- }
- return business;
- }
-
- public async Task> GetBusinessesAsync(string name)
- {
- var httpClient = _clientFactory.CreateClient("SubjectsApiClient");
- var response = await httpClient.GetAsync($"{httpClient.BaseAddress}/Businesses?name={name}&api-version=1");
- var business = new List();
- if (response.StatusCode != HttpStatusCode.NotFound)
- {
- response.EnsureSuccessStatusCode();
- business = JsonSerializer.Deserialize>(response.Content.ReadAsStream());
- }
- return business;
- }
-}
\ No newline at end of file
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Data/WeatherForecast.cs b/src/Subjects/Presentation/Web.BlazorServer/Data/WeatherForecast.cs
deleted file mode 100644
index f37dc94a..00000000
--- a/src/Subjects/Presentation/Web.BlazorServer/Data/WeatherForecast.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Goodtocode.Subjects.BlazorServer.Data
-{
- public class WeatherForecast
- {
- public DateOnly Date { get; set; }
-
- public int TemperatureC { get; set; }
-
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
-
- public string? Summary { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Data/WeatherForecastService.cs b/src/Subjects/Presentation/Web.BlazorServer/Data/WeatherForecastService.cs
deleted file mode 100644
index c505f651..00000000
--- a/src/Subjects/Presentation/Web.BlazorServer/Data/WeatherForecastService.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace Goodtocode.Subjects.BlazorServer.Data
-{
- public class WeatherForecastService
- {
- private static readonly string[] Summaries = new[]
- {
- "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
- };
-
- public Task GetForecastAsync(DateOnly startDate)
- {
- return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
- {
- Date = startDate.AddDays(index),
- TemperatureC = Random.Shared.Next(-20, 55),
- Summary = Summaries[Random.Shared.Next(Summaries.Length)]
- }).ToArray());
- }
- }
-}
\ No newline at end of file
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Pages/Business/BusinessList.razor b/src/Subjects/Presentation/Web.BlazorServer/Pages/Business/BusinessList.razor
deleted file mode 100644
index e0116c62..00000000
--- a/src/Subjects/Presentation/Web.BlazorServer/Pages/Business/BusinessList.razor
+++ /dev/null
@@ -1,58 +0,0 @@
-@page "/businesssearch"
-@using Goodtocode.Subjects.BlazorServer.Data;
-@using Goodtocode.Subjects.Domain;
-
-@inject BusinessService Service
-
-Business Search
-
-Business Search
-
-Search for businesses
-
-
-
-@if (businesses == null)
-{
- Please search for a business...
-}
-else if (businesses.Count() == 0)
-{
- Business not found
-}
-else
-{
-
-
-
- Key |
- Name |
- Tax Number |
-
-
-
- @foreach (var business in businesses)
- {
-
- @business.BusinessKey |
- @business.BusinessName |
- @business.TaxNumber |
-
- }
-
-
-}
-
-@code {
- private string businessName;
- private IEnumerable businesses;
-
- protected override async Task OnInitializedAsync()
- {
- }
-
- private async Task GetBusineses()
- {
- businesses = await Service.GetBusinessesAsync(businessName);
- }
-}
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Pages/To-Delete/Counter.razor b/src/Subjects/Presentation/Web.BlazorServer/Pages/To-Delete/Counter.razor
deleted file mode 100644
index 7d7c801d..00000000
--- a/src/Subjects/Presentation/Web.BlazorServer/Pages/To-Delete/Counter.razor
+++ /dev/null
@@ -1,17 +0,0 @@
-@page "/counter"
-
-Counter
-
-Counter
-
-Current count: @currentCount
-
-
-@code {
- private int currentCount = 0;
-
- private void IncrementCount()
- {
- currentCount++;
- }
-}
diff --git a/src/Subjects/Presentation/Web.BlazorServer/Pages/To-Delete/FetchData.razor b/src/Subjects/Presentation/Web.BlazorServer/Pages/To-Delete/FetchData.razor
deleted file mode 100644
index 74297a2f..00000000
--- a/src/Subjects/Presentation/Web.BlazorServer/Pages/To-Delete/FetchData.razor
+++ /dev/null
@@ -1,48 +0,0 @@
-@page "/fetchdata"
-@using Goodtocode.Subjects.BlazorServer.Data;
-
-@inject WeatherForecastService ForecastService
-
-Weather forecast
-
-Weather forecast
-
-This component demonstrates fetching data from a service.
-
-@if (forecasts == null)
-{
- Loading...
-}
-else
-{
-
-
-
- Date |
- Temp. (C) |
- Temp. (F) |
- Summary |
-
-
-
- @foreach (var forecast in forecasts)
- {
-
- @forecast.Date.ToShortDateString() |
- @forecast.TemperatureC |
- @forecast.TemperatureF |
- @forecast.Summary |
-
- }
-
-
-}
-
-@code {
- private WeatherForecast[]? forecasts;
-
- protected override async Task OnInitializedAsync()
- {
- forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
- }
-}
diff --git a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/favicon.png b/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/favicon.png
deleted file mode 100644
index 8422b596..00000000
Binary files a/src/Subjects/Presentation/Web.BlazorStatic/wwwroot/favicon.png and /dev/null differ
diff --git a/src/Subjects/Specs.Integration/Business/AddBusinessCommand.feature b/src/Subjects/Specs.Integration/Business/AddBusinessCommand.feature
new file mode 100644
index 00000000..8d155f3a
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Business/AddBusinessCommand.feature
@@ -0,0 +1,19 @@
+@addBusinessCommand
+Feature: Add Business Command
+As an customer service agent
+When I add business information
+The business is saved in system of record
+
+Scenario: Add business
+ Given I have a def ""
+ And I have a BusinessName ""
+ And I have a TaxNumber ""
+ When I add the business
+ Then The response is ""
+ And If the response has validation issues I see the "" in the response
+
+Examples:
+ | def | response | responseErrors | requestBusinessName | requestTaxNumber |
+ | success TaxNumber Add | Success | | businessName | 123-4567 |
+ | success Name Add | Success | | businessName | 123-4567 |
+ | bad request Missing BusinessName | BadRequest | BusinessName | | 123-4567 |
\ No newline at end of file
diff --git a/src/Subjects/Specs.Integration/Business/AddBusinessCommand.feature.cs b/src/Subjects/Specs.Integration/Business/AddBusinessCommand.feature.cs
new file mode 100644
index 00000000..c6ab65d7
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Business/AddBusinessCommand.feature.cs
@@ -0,0 +1,128 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (https://www.specflow.org/).
+// SpecFlow Version:3.9.0.0
+// SpecFlow Generator Version:3.9.0.0
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+#pragma warning disable
+namespace Goodtocode.Subjects.Integration.Business
+{
+ using TechTalk.SpecFlow;
+ using System;
+ using System.Linq;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Add Business Command")]
+ [NUnit.Framework.CategoryAttribute("addBusinessCommand")]
+ public partial class AddBusinessCommandFeature
+ {
+
+ private TechTalk.SpecFlow.ITestRunner testRunner;
+
+ private static string[] featureTags = new string[] {
+ "addBusinessCommand"};
+
+#line 1 "AddBusinessCommand.feature"
+#line hidden
+
+ [NUnit.Framework.OneTimeSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Add Business Command", "As an customer service agent\r\nWhen I add business information\r\nThe business is sa" +
+ "ved in system of record", ProgrammingLanguage.CSharp, featureTags);
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.OneTimeTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ [NUnit.Framework.SetUpAttribute()]
+ public void TestInitialize()
+ {
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public void TestTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioInitialize(scenarioInfo);
+ testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext);
+ }
+
+ public void ScenarioStart()
+ {
+ testRunner.OnScenarioStart();
+ }
+
+ public void ScenarioCleanup()
+ {
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Add business")]
+ [NUnit.Framework.TestCaseAttribute("success TaxNumber Add", "Success", "", "businessName", "123-4567", null)]
+ [NUnit.Framework.TestCaseAttribute("success Name Add", "Success", "", "businessName", "123-4567", null)]
+ [NUnit.Framework.TestCaseAttribute("bad request Missing BusinessName", "BadRequest", "BusinessName", "", "123-4567", null)]
+ public void AddBusiness(string def, string response, string responseErrors, string requestBusinessName, string requestTaxNumber, string[] exampleTags)
+ {
+ string[] tagsOfScenario = exampleTags;
+ System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary();
+ argumentsOfScenario.Add("def", def);
+ argumentsOfScenario.Add("response", response);
+ argumentsOfScenario.Add("responseErrors", responseErrors);
+ argumentsOfScenario.Add("requestBusinessName", requestBusinessName);
+ argumentsOfScenario.Add("requestTaxNumber", requestTaxNumber);
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add business", null, tagsOfScenario, argumentsOfScenario, featureTags);
+#line 7
+this.ScenarioInitialize(scenarioInfo);
+#line hidden
+ if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags)))
+ {
+ testRunner.SkipScenario();
+ }
+ else
+ {
+ this.ScenarioStart();
+#line 8
+ testRunner.Given(string.Format("I have a def \"{0}\"", def), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
+#line hidden
+#line 9
+ testRunner.And(string.Format("I have a BusinessName \"{0}\"", requestBusinessName), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+#line 10
+ testRunner.And(string.Format("I have a TaxNumber \"{0}\"", requestTaxNumber), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+#line 11
+ testRunner.When("I add the business", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
+#line hidden
+#line 12
+ testRunner.Then(string.Format("The response is \"{0}\"", response), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
+#line hidden
+#line 13
+ testRunner.And(string.Format("If the response has validation issues I see the \"{0}\" in the response", responseErrors), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+ }
+ this.ScenarioCleanup();
+ }
+ }
+}
+#pragma warning restore
+#endregion
diff --git a/src/Subjects/Specs.Integration/Business/AddBusinessCommandStepDefinitions.cs b/src/Subjects/Specs.Integration/Business/AddBusinessCommandStepDefinitions.cs
new file mode 100644
index 00000000..2192a4fc
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Business/AddBusinessCommandStepDefinitions.cs
@@ -0,0 +1,113 @@
+using FluentValidation.Results;
+using Goodtocode.Subjects.Application;
+using Goodtocode.Subjects.Application.Business.Commands;
+using Goodtocode.Subjects.Application.Common.Exceptions;
+using Moq;
+using System.Collections.Concurrent;
+using static Goodtocode.Subjects.Integration.Common.ResponseTypes;
+
+namespace Goodtocode.Subjects.Integration.Business;
+
+[Binding]
+[Scope(Tag = "addBusinessCommand")]
+public class AddBusinessCommandStepDefinitions : TestBase
+{
+ private IDictionary _commandErrors = new ConcurrentDictionary();
+ private string[]? _expectedInvalidFields;
+ private string _businessName = string.Empty;
+ private string _taxNumber = string.Empty;
+ private object _responseType = string.Empty;
+ private ValidationResult _validationErrors = new();
+
+ [Given(@"I have a def ""([^""]*)""")]
+ public void GivenIHaveADef(string def)
+ {
+ _def = def;
+ }
+
+ [Given(@"I have a BusinessName ""([^""]*)""")]
+ public void GivenIHaveABusinessName(string businessName)
+ {
+ _businessName = businessName;
+ }
+
+ [Given(@"I have a TaxNumber ""([^""]*)""")]
+ public void GivenIHaveATaxNumber(string taxNumber)
+ {
+ _taxNumber = taxNumber;
+ }
+
+ [When(@"I add the business")]
+ public async Task WhenIAddTheBusiness()
+ {
+ var request = new AddBusinessCommand
+ {
+ BusinessName = _businessName,
+ TaxNumber = _taxNumber
+ };
+
+ var requestValidator = new AddBusinessCommandValidator();
+
+ _validationErrors = await requestValidator.ValidateAsync(request);
+
+ if (_validationErrors.IsValid)
+ try
+ {
+ var handler = new AddBusinessCommandHandler(BusinessRepo);
+ await handler.Handle(request, CancellationToken.None);
+ _responseType = CommandResponseType.Successful;
+ }
+ catch (Exception e)
+ {
+ switch (e)
+ {
+ case ValidationException validationException:
+ _commandErrors = validationException.Errors;
+ _responseType = CommandResponseType.BadRequest;
+ break;
+ case ConflictException:
+ _responseType = CommandResponseType.Conflict;
+ break;
+ default:
+ _responseType = CommandResponseType.Error;
+ break;
+ }
+ }
+ else
+ _responseType = CommandResponseType.BadRequest;
+ }
+
+ [Then(@"The response is ""([^""]*)""")]
+ public void ThenTheResponseIs(string response)
+ {
+ switch (response)
+ {
+ case "Success":
+ _responseType.Should().Be(CommandResponseType.Successful);
+ break;
+ case "BadRequest":
+ _responseType.Should().Be(CommandResponseType.BadRequest);
+ break;
+ case "Conflict":
+ _responseType.Should().Be(CommandResponseType.Conflict);
+ break;
+ }
+ }
+
+ [Then(@"If the response has validation issues I see the ""([^""]*)"" in the response")]
+ public void ThenIfTheResponseHasValidationIssuesISeeTheInTheResponse(string expectedInvalidFields)
+ {
+ if (string.IsNullOrWhiteSpace(expectedInvalidFields)) return;
+
+ _expectedInvalidFields = expectedInvalidFields.Split(",");
+
+ foreach (var field in _expectedInvalidFields)
+ {
+ var hasCommandValidatorErrors = _validationErrors.Errors.Any(x => x.PropertyName == field.Trim());
+ var hasCommandErrors = _commandErrors.Any(x => x.Key == field.Trim());
+ var hasErrorMatch = hasCommandErrors || hasCommandValidatorErrors;
+
+ hasErrorMatch.Should().BeTrue();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Subjects/Specs.Integration/Business/DeleteBusinessCommand.feature b/src/Subjects/Specs.Integration/Business/DeleteBusinessCommand.feature
new file mode 100644
index 00000000..bc533114
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Business/DeleteBusinessCommand.feature
@@ -0,0 +1,19 @@
+@deleteBusinessCommand
+Feature: Delete Business Command
+As an customer service agent
+I delete the business
+The business is deleted from the system of record
+
+Scenario: Delete business
+ Given I have a def ""
+ And I have a BusinessKey ""
+ When I delete the business
+ Then The response is ""
+ And If the response has validation issues I see the "" in the response
+
+Examples:
+ | def | response | responseErrors | requestBusinessKey |
+ | success TaxNumber BusinessKey | Success | | 038213ba-9d95-42f3-8e8b-126cec10481b |
+ | not found BusinessKey | NotFound | | 038213ba-9d95-42f3-8e8b-126cec10481b |
+ | bad request Empty BusinessKey | BadRequest | BusinessKey | 00000000-0000-0000-0000-000000000000 |
+ | bad request non-guid BusinessKey | BadRequest | BusinessKey | 11111 |
\ No newline at end of file
diff --git a/src/Subjects/Specs.Integration/Business/DeleteBusinessCommand.feature.cs b/src/Subjects/Specs.Integration/Business/DeleteBusinessCommand.feature.cs
new file mode 100644
index 00000000..fec40662
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Business/DeleteBusinessCommand.feature.cs
@@ -0,0 +1,125 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (https://www.specflow.org/).
+// SpecFlow Version:3.9.0.0
+// SpecFlow Generator Version:3.9.0.0
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+#pragma warning disable
+namespace Goodtocode.Subjects.Integration.Business
+{
+ using TechTalk.SpecFlow;
+ using System;
+ using System.Linq;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Delete Business Command")]
+ [NUnit.Framework.CategoryAttribute("deleteBusinessCommand")]
+ public partial class DeleteBusinessCommandFeature
+ {
+
+ private TechTalk.SpecFlow.ITestRunner testRunner;
+
+ private static string[] featureTags = new string[] {
+ "deleteBusinessCommand"};
+
+#line 1 "DeleteBusinessCommand.feature"
+#line hidden
+
+ [NUnit.Framework.OneTimeSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Delete Business Command", "As an customer service agent\r\nI delete the business\r\nThe business is deleted from" +
+ " the system of record", ProgrammingLanguage.CSharp, featureTags);
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.OneTimeTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ [NUnit.Framework.SetUpAttribute()]
+ public void TestInitialize()
+ {
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public void TestTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioInitialize(scenarioInfo);
+ testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext);
+ }
+
+ public void ScenarioStart()
+ {
+ testRunner.OnScenarioStart();
+ }
+
+ public void ScenarioCleanup()
+ {
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Delete business")]
+ [NUnit.Framework.TestCaseAttribute("success TaxNumber BusinessKey", "Success", "", "038213ba-9d95-42f3-8e8b-126cec10481b", null)]
+ [NUnit.Framework.TestCaseAttribute("not found BusinessKey", "NotFound", "", "038213ba-9d95-42f3-8e8b-126cec10481b", null)]
+ [NUnit.Framework.TestCaseAttribute("bad request Empty BusinessKey", "BadRequest", "BusinessKey", "00000000-0000-0000-0000-000000000000", null)]
+ [NUnit.Framework.TestCaseAttribute("bad request non-guid BusinessKey", "BadRequest", "BusinessKey", "11111", null)]
+ public void DeleteBusiness(string def, string response, string responseErrors, string requestBusinessKey, string[] exampleTags)
+ {
+ string[] tagsOfScenario = exampleTags;
+ System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary();
+ argumentsOfScenario.Add("def", def);
+ argumentsOfScenario.Add("response", response);
+ argumentsOfScenario.Add("responseErrors", responseErrors);
+ argumentsOfScenario.Add("requestBusinessKey", requestBusinessKey);
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Delete business", null, tagsOfScenario, argumentsOfScenario, featureTags);
+#line 7
+this.ScenarioInitialize(scenarioInfo);
+#line hidden
+ if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags)))
+ {
+ testRunner.SkipScenario();
+ }
+ else
+ {
+ this.ScenarioStart();
+#line 8
+ testRunner.Given(string.Format("I have a def \"{0}\"", def), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
+#line hidden
+#line 9
+ testRunner.And(string.Format("I have a BusinessKey \"{0}\"", requestBusinessKey), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+#line 10
+ testRunner.When("I delete the business", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
+#line hidden
+#line 11
+ testRunner.Then(string.Format("The response is \"{0}\"", response), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
+#line hidden
+#line 12
+ testRunner.And(string.Format("If the response has validation issues I see the \"{0}\" in the response", responseErrors), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+ }
+ this.ScenarioCleanup();
+ }
+ }
+}
+#pragma warning restore
+#endregion
diff --git a/src/Subjects/Specs.Integration/Business/DeleteBusinessCommandStepDefinitions.cs b/src/Subjects/Specs.Integration/Business/DeleteBusinessCommandStepDefinitions.cs
new file mode 100644
index 00000000..c7ca2eb9
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Business/DeleteBusinessCommandStepDefinitions.cs
@@ -0,0 +1,104 @@
+using FluentValidation.Results;
+using Goodtocode.Subjects.Application;
+using Goodtocode.Subjects.Application.Business.Commands;
+using Goodtocode.Subjects.Application.Common.Exceptions;
+using System.Collections.Concurrent;
+using static Goodtocode.Subjects.Integration.Common.ResponseTypes;
+
+namespace Goodtocode.Subjects.Integration.Business;
+
+[Binding]
+[Scope(Tag = "deleteBusinessCommand")]
+public class DeleteBusinessCommandStepDefinitions : TestBase
+{
+ private IDictionary _commandErrors = new ConcurrentDictionary();
+ private string[]? _expectedInvalidFields;
+ private Guid _businessKey;
+ private object _responseType = string.Empty;
+ private ValidationResult _validationErrors = new();
+
+ [Given(@"I have a def ""([^""]*)""")]
+ public void GivenIHaveADef(string def)
+ {
+ _def = def;
+ }
+
+ [Given(@"I have a BusinessKey ""([^""]*)""")]
+ public void GivenIHaveABusinessKey(string businessKey)
+ {
+ Guid.TryParse(businessKey, out _businessKey);
+ }
+
+ [When(@"I delete the business")]
+ public async Task WhenIDeleteTheBusiness()
+ {
+ var request = new DeleteBusinessCommand
+ {
+ BusinessKey = _businessKey,
+ };
+
+ var requestValidator = new DeleteBusinessCommandValidator();
+
+ _validationErrors = await requestValidator.ValidateAsync(request);
+
+ if (_validationErrors.IsValid)
+ try
+ {
+ var handler = new DeleteBusinessCommandHandler(BusinessRepo);
+ await handler.Handle(request, CancellationToken.None);
+ _responseType = CommandResponseType.Successful;
+ }
+ catch (Exception e)
+ {
+ switch (e)
+ {
+ case ValidationException validationException:
+ _commandErrors = validationException.Errors;
+ _responseType = CommandResponseType.BadRequest;
+ break;
+ case NotFoundException notFoundException:
+ _responseType = CommandResponseType.NotFound;
+ break;
+ default:
+ _responseType = CommandResponseType.Error;
+ break;
+ }
+ }
+ else
+ _responseType = CommandResponseType.BadRequest;
+ }
+
+ [Then(@"The response is ""([^""]*)""")]
+ public void ThenTheResponseIs(string response)
+ {
+ switch (response)
+ {
+ case "Success":
+ _responseType.Should().Be(CommandResponseType.Successful);
+ break;
+ case "BadRequest":
+ _responseType.Should().Be(CommandResponseType.BadRequest);
+ break;
+ case "NotFound":
+ _responseType.Should().Be(CommandResponseType.NotFound);
+ break;
+ }
+ }
+
+ [Then(@"If the response has validation issues I see the ""([^""]*)"" in the response")]
+ public void ThenIfTheResponseHasValidationIssuesISeeTheInTheResponse(string expectedInvalidFields)
+ {
+ if (string.IsNullOrWhiteSpace(expectedInvalidFields)) return;
+
+ _expectedInvalidFields = expectedInvalidFields.Split(",");
+
+ foreach (var field in _expectedInvalidFields)
+ {
+ var hasCommandValidatorErrors = _validationErrors.Errors.Any(x => x.PropertyName == field.Trim());
+ var hasCommandErrors = _commandErrors.Any(x => x.Key == field.Trim());
+ var hasErrorMatch = hasCommandErrors || hasCommandValidatorErrors;
+
+ hasErrorMatch.Should().BeTrue();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKey.feature b/src/Subjects/Specs.Integration/Business/GetBusinessesByKey.feature
similarity index 82%
rename from src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKey.feature
rename to src/Subjects/Specs.Integration/Business/GetBusinessesByKey.feature
index ab511f03..038af5cd 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKey.feature
+++ b/src/Subjects/Specs.Integration/Business/GetBusinessesByKey.feature
@@ -7,7 +7,6 @@ Feature: Find Businesses by key
Scenario: Get Existing Business By Name
Given I have a def ""
And I have a BusinessKey ""
- And the business exists ""
When I query for matching Businesses
Then the response is ""
And if the response has validation issues I see the "" in the response
@@ -15,6 +14,7 @@ Scenario: Get Existing Business By Name
And the business has a matching BusinessKey of ""
Examples:
- | def | response | responseErrors | businessKey | businessExists |
- | success exists | Success | | 2016a497-e56c-4be8-8ef6-3dc5ae1699ce | true |
- | empty key | BadRequest | BusinessKey | 00000000-0000-0000-0000-000000000000 | false |
\ No newline at end of file
+ | def | response | responseErrors | businessKey |
+ | success exists | Success | | 2016a497-e56c-4be8-8ef6-3dc5ae1699ce |
+ | Business NotFound | NotFound | | 1234a497-1234-1234-8ef6-3dc5ae1699ce |
+ | empty key | BadRequest | BusinessKey | 00000000-0000-0000-0000-000000000000 |
\ No newline at end of file
diff --git a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKey.feature.cs b/src/Subjects/Specs.Integration/Business/GetBusinessesByKey.feature.cs
similarity index 88%
rename from src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKey.feature.cs
rename to src/Subjects/Specs.Integration/Business/GetBusinessesByKey.feature.cs
index ad90e0ec..abeec259 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKey.feature.cs
+++ b/src/Subjects/Specs.Integration/Business/GetBusinessesByKey.feature.cs
@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
-namespace Goodtocode.Subjects.Integration.Business.Queries
+namespace Goodtocode.Subjects.Integration.Business
{
using TechTalk.SpecFlow;
using System;
@@ -37,7 +37,7 @@ public partial class FindBusinessesByKeyFeature
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business/Queries", "Find Businesses by key", "\tAs a customer service rep\r\n\tWhen I search for a business by key critera\r\n\tI can " +
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Find Businesses by key", "\tAs a customer service rep\r\n\tWhen I search for a business by key critera\r\n\tI can " +
"see a exact match for a business", ProgrammingLanguage.CSharp, featureTags);
testRunner.OnFeatureStart(featureInfo);
}
@@ -78,9 +78,10 @@ public void ScenarioCleanup()
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Get Existing Business By Name")]
- [NUnit.Framework.TestCaseAttribute("success exists", "Success", "", "2016a497-e56c-4be8-8ef6-3dc5ae1699ce", "true", null)]
- [NUnit.Framework.TestCaseAttribute("empty key", "BadRequest", "BusinessKey", "00000000-0000-0000-0000-000000000000", "false", null)]
- public void GetExistingBusinessByName(string def, string response, string responseErrors, string businessKey, string businessExists, string[] exampleTags)
+ [NUnit.Framework.TestCaseAttribute("success exists", "Success", "", "2016a497-e56c-4be8-8ef6-3dc5ae1699ce", null)]
+ [NUnit.Framework.TestCaseAttribute("Business NotFound", "NotFound", "", "1234a497-1234-1234-8ef6-3dc5ae1699ce", null)]
+ [NUnit.Framework.TestCaseAttribute("empty key", "BadRequest", "BusinessKey", "00000000-0000-0000-0000-000000000000", null)]
+ public void GetExistingBusinessByName(string def, string response, string responseErrors, string businessKey, string[] exampleTags)
{
string[] tagsOfScenario = exampleTags;
System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary();
@@ -88,7 +89,6 @@ public void GetExistingBusinessByName(string def, string response, string respon
argumentsOfScenario.Add("response", response);
argumentsOfScenario.Add("responseErrors", responseErrors);
argumentsOfScenario.Add("businessKey", businessKey);
- argumentsOfScenario.Add("businessExists", businessExists);
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Get Existing Business By Name", null, tagsOfScenario, argumentsOfScenario, featureTags);
#line 7
this.ScenarioInitialize(scenarioInfo);
@@ -107,21 +107,18 @@ public void GetExistingBusinessByName(string def, string response, string respon
testRunner.And(string.Format("I have a BusinessKey \"{0}\"", businessKey), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
#line 10
- testRunner.And(string.Format("the business exists \"{0}\"", businessExists), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
-#line hidden
-#line 11
testRunner.When("I query for matching Businesses", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
-#line 12
+#line 11
testRunner.Then(string.Format("the response is \"{0}\"", response), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
-#line 13
+#line 12
testRunner.And(string.Format("if the response has validation issues I see the \"{0}\" in the response", responseErrors), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
-#line 14
+#line 13
testRunner.And("if the response is valid then the response contains a business", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
-#line 15
+#line 14
testRunner.And(string.Format("the business has a matching BusinessKey of \"{0}\"", businessKey), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
}
diff --git a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKeyStepDefinitions.cs b/src/Subjects/Specs.Integration/Business/GetBusinessesByKeyStepDefinitions.cs
similarity index 92%
rename from src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKeyStepDefinitions.cs
rename to src/Subjects/Specs.Integration/Business/GetBusinessesByKeyStepDefinitions.cs
index cd5b6626..faffe73f 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKeyStepDefinitions.cs
+++ b/src/Subjects/Specs.Integration/Business/GetBusinessesByKeyStepDefinitions.cs
@@ -6,7 +6,7 @@
using System.Collections.Concurrent;
using static Goodtocode.Subjects.Integration.Common.ResponseTypes;
-namespace Goodtocode.Subjects.Integration.Business.Queries;
+namespace Goodtocode.Subjects.Integration.Business;
[Binding]
[Scope(Tag = "getBusinessesByKey")]
@@ -18,8 +18,7 @@ public class GetBusinessesByKeyStepDefinitions : TestBase
private CommandResponseType _responseType;
private ValidationResult _validationErrors = new();
private Guid _businessKey = Guid.Empty;
- private bool _businessExists;
-
+
[Given(@"I have a def ""([^""]*)""")]
public void GivenIHaveADef(string def)
{
@@ -32,12 +31,6 @@ public void GivenIHaveABusinessName(Guid businessKey)
_businessKey = businessKey;
}
- [Given(@"the business exists ""([^""]*)""")]
- public void GivenTheBusinessExists(bool exists)
- {
- _businessExists = exists;
- }
-
[When(@"I query for matching Businesses")]
public async Task WhenIQueryForMatchingBusinesses()
{
@@ -54,7 +47,7 @@ public async Task WhenIQueryForMatchingBusinesses()
try
{
var handler = new GetBusinessQueryHandler(BusinessRepo, Mapper);
- _response = await handler.Handle(request, CancellationToken.None);
+ _response = await handler.Handle(request, CancellationToken.None) ?? new BusinessEntity();
_responseType = CommandResponseType.Successful;
}
catch (Exception e)
@@ -65,7 +58,7 @@ public async Task WhenIQueryForMatchingBusinesses()
_commandErrors = validationException.Errors;
_responseType = CommandResponseType.BadRequest;
break;
- case NotFoundException notFoundException:
+ case NotFoundException:
_responseType = CommandResponseType.NotFound;
break;
default:
diff --git a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByName.feature b/src/Subjects/Specs.Integration/Business/GetBusinessesByName.feature
similarity index 100%
rename from src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByName.feature
rename to src/Subjects/Specs.Integration/Business/GetBusinessesByName.feature
diff --git a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByName.feature.cs b/src/Subjects/Specs.Integration/Business/GetBusinessesByName.feature.cs
similarity index 96%
rename from src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByName.feature.cs
rename to src/Subjects/Specs.Integration/Business/GetBusinessesByName.feature.cs
index 059a2c6e..473f7b2e 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByName.feature.cs
+++ b/src/Subjects/Specs.Integration/Business/GetBusinessesByName.feature.cs
@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
-namespace Goodtocode.Subjects.Unit.Business.Queries
+namespace Goodtocode.Subjects.Integration.Business
{
using TechTalk.SpecFlow;
using System;
@@ -37,7 +37,7 @@ public partial class FindBusinessesByNameFeature
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business/Queries", "Find Businesses by name", "\tAs a customer service rep\r\n\tWhen I search for a business by name critera\r\n\tI can" +
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Find Businesses by name", "\tAs a customer service rep\r\n\tWhen I search for a business by name critera\r\n\tI can" +
" see a list of businesses that match the name criteria", ProgrammingLanguage.CSharp, featureTags);
testRunner.OnFeatureStart(featureInfo);
}
diff --git a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByNameStepDefinitions.cs b/src/Subjects/Specs.Integration/Business/GetBusinessesByNameStepDefinitions.cs
similarity index 91%
rename from src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByNameStepDefinitions.cs
rename to src/Subjects/Specs.Integration/Business/GetBusinessesByNameStepDefinitions.cs
index e195c63e..8af7fecd 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByNameStepDefinitions.cs
+++ b/src/Subjects/Specs.Integration/Business/GetBusinessesByNameStepDefinitions.cs
@@ -6,7 +6,7 @@
using System.Collections.Concurrent;
using static Goodtocode.Subjects.Integration.Common.ResponseTypes;
-namespace Goodtocode.Subjects.Integration.Business.Queries;
+namespace Goodtocode.Subjects.Integration.Business;
[Binding]
[Scope(Tag = "getBusinessesByName")]
@@ -17,8 +17,7 @@ public class GetBusinessesByNameStepDefinitions : TestBase
private List _response = new();
private CommandResponseType _responseType;
private ValidationResult _validationErrors = new();
- private string _businessName = String.Empty;
- private bool _businessExists;
+ private string _businessName = string.Empty;
[Given(@"I have a def ""([^""]*)""")]
public void GivenIHaveADef(string p0)
@@ -32,17 +31,9 @@ public void GivenIHaveABusinessName(string businessInDb)
_businessName = businessInDb;
}
- [Given(@"the business exists ""([^""]*)""")]
- public void GivenTheBusinessExists(bool exists)
- {
- _businessExists = exists;
- }
-
[When(@"I query for matching Businesses")]
public async Task WhenIQueryForMatchingBusinesses()
{
- var userBusinessesRepoMock = new Mock();
-
var request = new GetBusinessesByNameQuery
{
BusinessName = _businessName
@@ -67,7 +58,7 @@ public async Task WhenIQueryForMatchingBusinesses()
_commandErrors = validationException.Errors;
_responseType = CommandResponseType.BadRequest;
break;
- case NotFoundException notFoundException:
+ case NotFoundException:
_responseType = CommandResponseType.NotFound;
break;
default:
diff --git a/src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommand.feature b/src/Subjects/Specs.Integration/Business/UpdateBusinessCommand.feature
similarity index 95%
rename from src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommand.feature
rename to src/Subjects/Specs.Integration/Business/UpdateBusinessCommand.feature
index 87ef5ef2..c3679e38 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommand.feature
+++ b/src/Subjects/Specs.Integration/Business/UpdateBusinessCommand.feature
@@ -16,9 +16,9 @@ Scenario: Update business
Examples:
| def | response | responseErrors | requestBusinessKey | requestBusinessName | requestTaxNumber |
| success TaxNumber Add | Success | | d1604a05-f883-40f1-803b-8562b5674f1a | businessName | 123-4567 |
- | success TaxNumber Update | Success | | d1604a05-f883-40f1-803b-8562b5674f1a | businessName | 123-4567 |
+ | success TaxNumber Update | Success | | d1604a05-f883-40f1-803b-8562b5674f1a | businessName | 123-5678 |
| success TaxNumber Remove | Success | | d1604a05-f883-40f1-803b-8562b5674f1a | businessName | |
- | success Name Update | Success | | d1604a05-f883-40f1-803b-8562b5674f1a | businessName | 123-4567 |
+ | success Name Update | Success | | d1604a05-f883-40f1-803b-8562b5674f1a | businessName Updates | 123-4567 |
| bad request Invalid BusinessKey | BadRequest | BusinessKey | 11111 | businessName | 123-4567 |
| bad request Invalid BusinessName | BadRequest | BusinessName | d1604a05-f883-40f1-803b-8562b5674f1a | | 123-4567 |
| bad request | BadRequest | BusinessKey,BusinessName | 11111 | | |
\ No newline at end of file
diff --git a/src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommand.feature.cs b/src/Subjects/Specs.Integration/Business/UpdateBusinessCommand.feature.cs
similarity index 95%
rename from src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommand.feature.cs
rename to src/Subjects/Specs.Integration/Business/UpdateBusinessCommand.feature.cs
index 0ff74c16..d70920fb 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommand.feature.cs
+++ b/src/Subjects/Specs.Integration/Business/UpdateBusinessCommand.feature.cs
@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
-namespace Goodtocode.Subjects.Unit.Business.Commands.Update
+namespace Goodtocode.Subjects.Integration.Business
{
using TechTalk.SpecFlow;
using System;
@@ -37,7 +37,7 @@ public partial class UpdateBusinessCommandFeature
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business/Commands/Update", "Update Business Command", "As an customer service agent\r\nI can change business information\r\nAnd get the syst" +
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Update Business Command", "As an customer service agent\r\nI can change business information\r\nAnd get the syst" +
"em of record updated", ProgrammingLanguage.CSharp, featureTags);
testRunner.OnFeatureStart(featureInfo);
}
@@ -79,9 +79,9 @@ public void ScenarioCleanup()
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Update business")]
[NUnit.Framework.TestCaseAttribute("success TaxNumber Add", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", "businessName", "123-4567", null)]
- [NUnit.Framework.TestCaseAttribute("success TaxNumber Update", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", "businessName", "123-4567", null)]
+ [NUnit.Framework.TestCaseAttribute("success TaxNumber Update", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", "businessName", "123-5678", null)]
[NUnit.Framework.TestCaseAttribute("success TaxNumber Remove", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", "businessName", "", null)]
- [NUnit.Framework.TestCaseAttribute("success Name Update", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", "businessName", "123-4567", null)]
+ [NUnit.Framework.TestCaseAttribute("success Name Update", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", "businessName Updates", "123-4567", null)]
[NUnit.Framework.TestCaseAttribute("bad request Invalid BusinessKey", "BadRequest", "BusinessKey", "11111", "businessName", "123-4567", null)]
[NUnit.Framework.TestCaseAttribute("bad request Invalid BusinessName", "BadRequest", "BusinessName", "d1604a05-f883-40f1-803b-8562b5674f1a", "", "123-4567", null)]
[NUnit.Framework.TestCaseAttribute("bad request", "BadRequest", "BusinessKey,BusinessName", "11111", "", "", null)]
diff --git a/src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommandStepDefinitions.cs b/src/Subjects/Specs.Integration/Business/UpdateBusinessCommandStepDefinitions.cs
similarity index 96%
rename from src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommandStepDefinitions.cs
rename to src/Subjects/Specs.Integration/Business/UpdateBusinessCommandStepDefinitions.cs
index 9daca34c..4e2f5c9d 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommandStepDefinitions.cs
+++ b/src/Subjects/Specs.Integration/Business/UpdateBusinessCommandStepDefinitions.cs
@@ -5,7 +5,7 @@
using System.Collections.Concurrent;
using static Goodtocode.Subjects.Integration.Common.ResponseTypes;
-namespace Goodtocode.Subjects.Integration.Business.Commands;
+namespace Goodtocode.Subjects.Integration.Business;
[Binding]
[Scope(Tag = "updateBusinessCommand")]
@@ -61,7 +61,7 @@ public async Task WhenIUpdateTheBusiness()
if (_validationErrors.IsValid)
try
{
- var handler = new UpdateBusinessCommandHandler(base.BusinessRepo);
+ var handler = new UpdateBusinessCommandHandler(BusinessRepo);
await handler.Handle(request, CancellationToken.None);
_responseType = CommandResponseType.Successful;
}
diff --git a/src/Subjects/Specs.Integration/Common/ContextSeeder.cs b/src/Subjects/Specs.Integration/Common/ContextSeeder.cs
new file mode 100644
index 00000000..65ca2eeb
--- /dev/null
+++ b/src/Subjects/Specs.Integration/Common/ContextSeeder.cs
@@ -0,0 +1,34 @@
+using Goodtocode.Subjects.Application;
+using Goodtocode.Subjects.Domain;
+
+namespace Goodtocode.Subjects.Integration.Common;
+internal class ContextSeeder : IContextSeeder
+{
+ public async Task SeedSampleDataAsync(ISubjectsDbContext context)
+ {
+ await context.Business.AddRangeAsync(new List
+ {
+ new BusinessEntity()
+ {
+ BusinessKey = new Guid("2016a497-e56c-4be8-8ef6-3dc5ae1699ce"),
+ BusinessName = "BusinessInDb",
+ TaxNumber = "123-45678"
+ },
+ new BusinessEntity()
+ {
+ BusinessKey = new Guid("d1604a05-f883-40f1-803b-8562b5674f1a"),
+ BusinessName = "Business To Update",
+ TaxNumber = "123-45678"
+ },
+ new BusinessEntity()
+ {
+ BusinessKey = new Guid("038213ba-9d95-42f3-8e8b-126cec10481b"),
+ BusinessName = "Business To Delete",
+ TaxNumber = "123-45678"
+ }
+ }
+ );
+
+ await context.SaveChangesAsync(CancellationToken.None);
+ }
+}
diff --git a/src/Subjects/Specs/Application.Integration/Common/IContextSeeder.cs b/src/Subjects/Specs.Integration/Common/IContextSeeder.cs
similarity index 100%
rename from src/Subjects/Specs/Application.Integration/Common/IContextSeeder.cs
rename to src/Subjects/Specs.Integration/Common/IContextSeeder.cs
diff --git a/src/Subjects/Specs/Application.Integration/Common/ResponseTypes.cs b/src/Subjects/Specs.Integration/Common/ResponseTypes.cs
similarity index 92%
rename from src/Subjects/Specs/Application.Integration/Common/ResponseTypes.cs
rename to src/Subjects/Specs.Integration/Common/ResponseTypes.cs
index 06361e3e..be470f53 100644
--- a/src/Subjects/Specs/Application.Integration/Common/ResponseTypes.cs
+++ b/src/Subjects/Specs.Integration/Common/ResponseTypes.cs
@@ -7,6 +7,7 @@ public enum CommandResponseType
Successful,
BadRequest,
NotFound,
+ Conflict,
Error
}
}
diff --git a/src/Subjects/Specs/Application.Integration/ImplicitUsings.cs b/src/Subjects/Specs.Integration/ImplicitUsings.cs
similarity index 100%
rename from src/Subjects/Specs/Application.Integration/ImplicitUsings.cs
rename to src/Subjects/Specs.Integration/ImplicitUsings.cs
diff --git a/src/Subjects/Specs/Application.Integration/Application.Integration.csproj b/src/Subjects/Specs.Integration/Specs.Integration.csproj
similarity index 59%
rename from src/Subjects/Specs/Application.Integration/Application.Integration.csproj
rename to src/Subjects/Specs.Integration/Specs.Integration.csproj
index 183a418b..fad46ea3 100644
--- a/src/Subjects/Specs/Application.Integration/Application.Integration.csproj
+++ b/src/Subjects/Specs.Integration/Specs.Integration.csproj
@@ -10,8 +10,7 @@
-
-
+
@@ -29,7 +28,7 @@
-
+
@@ -39,26 +38,36 @@
-
- UpdateBusinessCommand.feature
+
+ %(Filename)
-
+
+ true
+ %(Filename)
+ true
+ true
+
+
GetBusinessesByKey.feature
-
+
GetBusinessesByName.feature
-
- $(UsingMicrosoftNETSdk)
- %(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
+
+ $(UsingMicrosoftNETSdk)
+ %(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
+
+
+ $(UsingMicrosoftNETSdk)
+ %(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
-
+
$(UsingMicrosoftNETSdk)
%(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
-
+
$(UsingMicrosoftNETSdk)
%(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
diff --git a/src/Subjects/Specs/Application.Integration/TestBase.cs b/src/Subjects/Specs.Integration/TestBase.cs
similarity index 96%
rename from src/Subjects/Specs/Application.Integration/TestBase.cs
rename to src/Subjects/Specs.Integration/TestBase.cs
index 15f1b859..9845a4b4 100644
--- a/src/Subjects/Specs/Application.Integration/TestBase.cs
+++ b/src/Subjects/Specs.Integration/TestBase.cs
@@ -4,6 +4,7 @@
using Goodtocode.Subjects.Integration.Common;
using Goodtocode.Subjects.Persistence;
using Goodtocode.Subjects.Persistence.Contexts;
+using Goodtocode.Subjects.Persistence.Repositories;
namespace Goodtocode.Application.Integration;
@@ -14,18 +15,17 @@ public class TestBase
private static IConfigurationRoot _configuration = null!;
private static IServiceScopeFactory _scopeFactory = null!;
+ public IMapper Mapper { get; }
+ public IBusinessRepo BusinessRepo { get; private set; }
+
public TestBase()
{
Mapper = new MapperConfiguration(cfg => { cfg.AddProfile(); })
.CreateMapper();
-
RunBeforeAnyTests();
+ BusinessRepo ??= new Mock().Object;
}
- public IMapper Mapper { get; }
-
- public IBusinessRepo? BusinessRepo { get; private set; }
-
[OneTimeSetUp]
public void RunBeforeAnyTests()
{
@@ -51,7 +51,7 @@ public void RunBeforeAnyTests()
_scopeFactory = services.BuildServiceProvider().GetRequiredService();
var sp = services.BuildServiceProvider();
BusinessRepo = sp.GetRequiredService();
-
+
SeedContext();
}
diff --git a/src/Subjects/Specs/Application.Integration/appsettings.test.json b/src/Subjects/Specs.Integration/appsettings.test.json
similarity index 100%
rename from src/Subjects/Specs/Application.Integration/appsettings.test.json
rename to src/Subjects/Specs.Integration/appsettings.test.json
diff --git a/src/Subjects/Specs.Unit/Business/AddBusinessCommand.feature b/src/Subjects/Specs.Unit/Business/AddBusinessCommand.feature
new file mode 100644
index 00000000..8d155f3a
--- /dev/null
+++ b/src/Subjects/Specs.Unit/Business/AddBusinessCommand.feature
@@ -0,0 +1,19 @@
+@addBusinessCommand
+Feature: Add Business Command
+As an customer service agent
+When I add business information
+The business is saved in system of record
+
+Scenario: Add business
+ Given I have a def ""
+ And I have a BusinessName ""
+ And I have a TaxNumber ""
+ When I add the business
+ Then The response is ""
+ And If the response has validation issues I see the "" in the response
+
+Examples:
+ | def | response | responseErrors | requestBusinessName | requestTaxNumber |
+ | success TaxNumber Add | Success | | businessName | 123-4567 |
+ | success Name Add | Success | | businessName | 123-4567 |
+ | bad request Missing BusinessName | BadRequest | BusinessName | | 123-4567 |
\ No newline at end of file
diff --git a/src/Subjects/Specs.Unit/Business/AddBusinessCommand.feature.cs b/src/Subjects/Specs.Unit/Business/AddBusinessCommand.feature.cs
new file mode 100644
index 00000000..b2d06f51
--- /dev/null
+++ b/src/Subjects/Specs.Unit/Business/AddBusinessCommand.feature.cs
@@ -0,0 +1,128 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (https://www.specflow.org/).
+// SpecFlow Version:3.9.0.0
+// SpecFlow Generator Version:3.9.0.0
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+#pragma warning disable
+namespace Goodtocode.Subjects.Unit.Business
+{
+ using TechTalk.SpecFlow;
+ using System;
+ using System.Linq;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Add Business Command")]
+ [NUnit.Framework.CategoryAttribute("addBusinessCommand")]
+ public partial class AddBusinessCommandFeature
+ {
+
+ private TechTalk.SpecFlow.ITestRunner testRunner;
+
+ private static string[] featureTags = new string[] {
+ "addBusinessCommand"};
+
+#line 1 "AddBusinessCommand.feature"
+#line hidden
+
+ [NUnit.Framework.OneTimeSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Add Business Command", "As an customer service agent\r\nWhen I add business information\r\nThe business is sa" +
+ "ved in system of record", ProgrammingLanguage.CSharp, featureTags);
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.OneTimeTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ [NUnit.Framework.SetUpAttribute()]
+ public void TestInitialize()
+ {
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public void TestTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioInitialize(scenarioInfo);
+ testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext);
+ }
+
+ public void ScenarioStart()
+ {
+ testRunner.OnScenarioStart();
+ }
+
+ public void ScenarioCleanup()
+ {
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Add business")]
+ [NUnit.Framework.TestCaseAttribute("success TaxNumber Add", "Success", "", "businessName", "123-4567", null)]
+ [NUnit.Framework.TestCaseAttribute("success Name Add", "Success", "", "businessName", "123-4567", null)]
+ [NUnit.Framework.TestCaseAttribute("bad request Missing BusinessName", "BadRequest", "BusinessName", "", "123-4567", null)]
+ public void AddBusiness(string def, string response, string responseErrors, string requestBusinessName, string requestTaxNumber, string[] exampleTags)
+ {
+ string[] tagsOfScenario = exampleTags;
+ System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary();
+ argumentsOfScenario.Add("def", def);
+ argumentsOfScenario.Add("response", response);
+ argumentsOfScenario.Add("responseErrors", responseErrors);
+ argumentsOfScenario.Add("requestBusinessName", requestBusinessName);
+ argumentsOfScenario.Add("requestTaxNumber", requestTaxNumber);
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add business", null, tagsOfScenario, argumentsOfScenario, featureTags);
+#line 7
+this.ScenarioInitialize(scenarioInfo);
+#line hidden
+ if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags)))
+ {
+ testRunner.SkipScenario();
+ }
+ else
+ {
+ this.ScenarioStart();
+#line 8
+ testRunner.Given(string.Format("I have a def \"{0}\"", def), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
+#line hidden
+#line 9
+ testRunner.And(string.Format("I have a BusinessName \"{0}\"", requestBusinessName), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+#line 10
+ testRunner.And(string.Format("I have a TaxNumber \"{0}\"", requestTaxNumber), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+#line 11
+ testRunner.When("I add the business", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
+#line hidden
+#line 12
+ testRunner.Then(string.Format("The response is \"{0}\"", response), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
+#line hidden
+#line 13
+ testRunner.And(string.Format("If the response has validation issues I see the \"{0}\" in the response", responseErrors), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+ }
+ this.ScenarioCleanup();
+ }
+ }
+}
+#pragma warning restore
+#endregion
diff --git a/src/Subjects/Specs.Unit/Business/AddBusinessCommandStepDefinitions.cs b/src/Subjects/Specs.Unit/Business/AddBusinessCommandStepDefinitions.cs
new file mode 100644
index 00000000..8500ca33
--- /dev/null
+++ b/src/Subjects/Specs.Unit/Business/AddBusinessCommandStepDefinitions.cs
@@ -0,0 +1,115 @@
+using FluentValidation.Results;
+using Goodtocode.Subjects.Application;
+using Goodtocode.Subjects.Application.Business.Commands;
+using Goodtocode.Subjects.Application.Common.Exceptions;
+using Moq;
+using System.Collections.Concurrent;
+using static Goodtocode.Subjects.Unit.Common.ResponseTypes;
+
+namespace Goodtocode.Subjects.Unit.Business;
+
+[Binding]
+[Scope(Tag = "addBusinessCommand")]
+public class AddBusinessCommandStepDefinitions : TestBase
+{
+ private IDictionary _commandErrors = new ConcurrentDictionary();
+ private string[]? _expectedInvalidFields;
+ private string _businessName = string.Empty;
+ private string _taxNumber = string.Empty;
+ private object _responseType = string.Empty;
+ private ValidationResult _validationErrors = new();
+
+ [Given(@"I have a def ""([^""]*)""")]
+ public void GivenIHaveADef(string def)
+ {
+ _def = def;
+ }
+
+ [Given(@"I have a BusinessName ""([^""]*)""")]
+ public void GivenIHaveABusinessName(string businessName)
+ {
+ _businessName = businessName;
+ }
+
+ [Given(@"I have a TaxNumber ""([^""]*)""")]
+ public void GivenIHaveATaxNumber(string taxNumber)
+ {
+ _taxNumber = taxNumber;
+ }
+
+ [When(@"I add the business")]
+ public async Task WhenIAddTheBusiness()
+ {
+ var userBusinessRepoMock = new Mock();
+
+ var request = new AddBusinessCommand
+ {
+ BusinessName = _businessName,
+ TaxNumber = _taxNumber
+ };
+
+ var requestValidator = new AddBusinessCommandValidator();
+
+ _validationErrors = await requestValidator.ValidateAsync(request);
+
+ if (_validationErrors.IsValid)
+ try
+ {
+ var handler = new AddBusinessCommandHandler(userBusinessRepoMock.Object);
+ await handler.Handle(request, CancellationToken.None);
+ _responseType = CommandResponseType.Successful;
+ }
+ catch (Exception e)
+ {
+ switch (e)
+ {
+ case ValidationException validationException:
+ _commandErrors = validationException.Errors;
+ _responseType = CommandResponseType.BadRequest;
+ break;
+ case ConflictException:
+ _responseType = CommandResponseType.Conflict;
+ break;
+ default:
+ _responseType = CommandResponseType.Error;
+ break;
+ }
+ }
+ else
+ _responseType = CommandResponseType.BadRequest;
+ }
+
+ [Then(@"The response is ""([^""]*)""")]
+ public void ThenTheResponseIs(string response)
+ {
+ switch (response)
+ {
+ case "Success":
+ _responseType.Should().Be(CommandResponseType.Successful);
+ break;
+ case "BadRequest":
+ _responseType.Should().Be(CommandResponseType.BadRequest);
+ break;
+ case "Conflict":
+ _responseType.Should().Be(CommandResponseType.Conflict);
+ break;
+ }
+ }
+
+ [Then(@"If the response has validation issues I see the ""([^""]*)"" in the response")]
+ public void ThenIfTheResponseHasValidationIssuesISeeTheInTheResponse(string expectedInvalidFields)
+ {
+ if (string.IsNullOrWhiteSpace(expectedInvalidFields)) return;
+
+ _expectedInvalidFields = expectedInvalidFields.Split(",");
+
+ foreach (var field in _expectedInvalidFields)
+ {
+ var hasCommandValidatorErrors = _validationErrors.Errors.Any(x => x.PropertyName == field.Trim());
+ var hasCommandErrors = _commandErrors.Any(x => x.Key == field.Trim());
+ var hasErrorMatch = hasCommandErrors || hasCommandValidatorErrors;
+
+ hasErrorMatch.Should().BeTrue();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Subjects/Specs.Unit/Business/DeleteBusinessCommand.feature b/src/Subjects/Specs.Unit/Business/DeleteBusinessCommand.feature
new file mode 100644
index 00000000..f1199eee
--- /dev/null
+++ b/src/Subjects/Specs.Unit/Business/DeleteBusinessCommand.feature
@@ -0,0 +1,17 @@
+@deleteBusinessCommand
+Feature: Delete Business Command
+As an customer service agent
+I delete the business
+The business is deleted from the system of record
+
+Scenario: Delete business
+ Given I have a def ""
+ And I have a BusinessKey ""
+ When I delete the business
+ Then The response is ""
+ And If the response has validation issues I see the "" in the response
+
+Examples:
+ | def | response | responseErrors | requestBusinessKey |
+ | success TaxNumber BusinessKey | Success | | d1604a05-f883-40f1-803b-8562b5674f1a |
+ | bad request Empty BusinessKey | BadRequest | BusinessKey | 00000000-0000-0000-0000-000000000000 |
\ No newline at end of file
diff --git a/src/Subjects/Specs.Unit/Business/DeleteBusinessCommand.feature.cs b/src/Subjects/Specs.Unit/Business/DeleteBusinessCommand.feature.cs
new file mode 100644
index 00000000..1c1e19f9
--- /dev/null
+++ b/src/Subjects/Specs.Unit/Business/DeleteBusinessCommand.feature.cs
@@ -0,0 +1,123 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (https://www.specflow.org/).
+// SpecFlow Version:3.9.0.0
+// SpecFlow Generator Version:3.9.0.0
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+#pragma warning disable
+namespace Goodtocode.Subjects.Unit.Business
+{
+ using TechTalk.SpecFlow;
+ using System;
+ using System.Linq;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Delete Business Command")]
+ [NUnit.Framework.CategoryAttribute("deleteBusinessCommand")]
+ public partial class DeleteBusinessCommandFeature
+ {
+
+ private TechTalk.SpecFlow.ITestRunner testRunner;
+
+ private static string[] featureTags = new string[] {
+ "deleteBusinessCommand"};
+
+#line 1 "DeleteBusinessCommand.feature"
+#line hidden
+
+ [NUnit.Framework.OneTimeSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Delete Business Command", "As an customer service agent\r\nI delete the business\r\nThe business is deleted from" +
+ " the system of record", ProgrammingLanguage.CSharp, featureTags);
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.OneTimeTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ [NUnit.Framework.SetUpAttribute()]
+ public void TestInitialize()
+ {
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public void TestTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioInitialize(scenarioInfo);
+ testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext);
+ }
+
+ public void ScenarioStart()
+ {
+ testRunner.OnScenarioStart();
+ }
+
+ public void ScenarioCleanup()
+ {
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Delete business")]
+ [NUnit.Framework.TestCaseAttribute("success TaxNumber BusinessKey", "Success", "", "d1604a05-f883-40f1-803b-8562b5674f1a", null)]
+ [NUnit.Framework.TestCaseAttribute("bad request Empty BusinessKey", "BadRequest", "BusinessKey", "00000000-0000-0000-0000-000000000000", null)]
+ public void DeleteBusiness(string def, string response, string responseErrors, string requestBusinessKey, string[] exampleTags)
+ {
+ string[] tagsOfScenario = exampleTags;
+ System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary();
+ argumentsOfScenario.Add("def", def);
+ argumentsOfScenario.Add("response", response);
+ argumentsOfScenario.Add("responseErrors", responseErrors);
+ argumentsOfScenario.Add("requestBusinessKey", requestBusinessKey);
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Delete business", null, tagsOfScenario, argumentsOfScenario, featureTags);
+#line 7
+this.ScenarioInitialize(scenarioInfo);
+#line hidden
+ if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags)))
+ {
+ testRunner.SkipScenario();
+ }
+ else
+ {
+ this.ScenarioStart();
+#line 8
+ testRunner.Given(string.Format("I have a def \"{0}\"", def), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
+#line hidden
+#line 9
+ testRunner.And(string.Format("I have a BusinessKey \"{0}\"", requestBusinessKey), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+#line 10
+ testRunner.When("I delete the business", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
+#line hidden
+#line 11
+ testRunner.Then(string.Format("The response is \"{0}\"", response), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
+#line hidden
+#line 12
+ testRunner.And(string.Format("If the response has validation issues I see the \"{0}\" in the response", responseErrors), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
+#line hidden
+ }
+ this.ScenarioCleanup();
+ }
+ }
+}
+#pragma warning restore
+#endregion
diff --git a/src/Subjects/Specs.Unit/Business/DeleteBusinessCommandStepDefinitions.cs b/src/Subjects/Specs.Unit/Business/DeleteBusinessCommandStepDefinitions.cs
new file mode 100644
index 00000000..710d86aa
--- /dev/null
+++ b/src/Subjects/Specs.Unit/Business/DeleteBusinessCommandStepDefinitions.cs
@@ -0,0 +1,107 @@
+using FluentValidation.Results;
+using Goodtocode.Subjects.Application;
+using Goodtocode.Subjects.Application.Business.Commands;
+using Goodtocode.Subjects.Application.Common.Exceptions;
+using Moq;
+using System.Collections.Concurrent;
+using static Goodtocode.Subjects.Unit.Common.ResponseTypes;
+
+namespace Goodtocode.Subjects.Unit.Business;
+
+[Binding]
+[Scope(Tag = "deleteBusinessCommand")]
+public class DeleteBusinessCommandStepDefinitions : TestBase
+{
+ private IDictionary _commandErrors = new ConcurrentDictionary();
+ private string[]? _expectedInvalidFields;
+ private Guid _businessKey;
+ private object _responseType = string.Empty;
+ private ValidationResult _validationErrors = new();
+
+ [Given(@"I have a def ""([^""]*)""")]
+ public void GivenIHaveADef(string def)
+ {
+ _def = def;
+ }
+
+ [Given(@"I have a BusinessKey ""([^""]*)""")]
+ public void GivenIHaveABusinessKey(string businessKey)
+ {
+ _businessKey = Guid.Parse(businessKey);
+ }
+
+ [When(@"I delete the business")]
+ public async Task WhenIDeleteTheBusiness()
+ {
+ var userBusinessRepoMock = new Mock();
+
+ var request = new DeleteBusinessCommand
+ {
+ BusinessKey = _businessKey,
+ };
+
+ var requestValidator = new DeleteBusinessCommandValidator();
+
+ _validationErrors = await requestValidator.ValidateAsync(request);
+
+ if (_validationErrors.IsValid)
+ try
+ {
+ var handler = new DeleteBusinessCommandHandler(userBusinessRepoMock.Object);
+ await handler.Handle(request, CancellationToken.None);
+ _responseType = CommandResponseType.Successful;
+ }
+ catch (Exception e)
+ {
+ switch (e)
+ {
+ case ValidationException validationException:
+ _commandErrors = validationException.Errors;
+ _responseType = CommandResponseType.BadRequest;
+ break;
+ case NotFoundException:
+ _responseType = CommandResponseType.NotFound;
+ break;
+ default:
+ _responseType = CommandResponseType.Error;
+ break;
+ }
+ }
+ else
+ _responseType = CommandResponseType.BadRequest;
+ }
+
+ [Then(@"The response is ""([^""]*)""")]
+ public void ThenTheResponseIs(string response)
+ {
+ switch (response)
+ {
+ case "Success":
+ _responseType.Should().Be(CommandResponseType.Successful);
+ break;
+ case "BadRequest":
+ _responseType.Should().Be(CommandResponseType.BadRequest);
+ break;
+ case "NotFound":
+ _responseType.Should().Be(CommandResponseType.NotFound);
+ break;
+ }
+ }
+
+ [Then(@"If the response has validation issues I see the ""([^""]*)"" in the response")]
+ public void ThenIfTheResponseHasValidationIssuesISeeTheInTheResponse(string expectedInvalidFields)
+ {
+ if (string.IsNullOrWhiteSpace(expectedInvalidFields)) return;
+
+ _expectedInvalidFields = expectedInvalidFields.Split(",");
+
+ foreach (var field in _expectedInvalidFields)
+ {
+ var hasCommandValidatorErrors = _validationErrors.Errors.Any(x => x.PropertyName == field.Trim());
+ var hasCommandErrors = _commandErrors.Any(x => x.Key == field.Trim());
+ var hasErrorMatch = hasCommandErrors || hasCommandValidatorErrors;
+
+ hasErrorMatch.Should().BeTrue();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKey.feature b/src/Subjects/Specs.Unit/Business/GetBusinessesByKey.feature
similarity index 100%
rename from src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByKey.feature
rename to src/Subjects/Specs.Unit/Business/GetBusinessesByKey.feature
diff --git a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKey.feature.cs b/src/Subjects/Specs.Unit/Business/GetBusinessesByKey.feature.cs
similarity index 96%
rename from src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKey.feature.cs
rename to src/Subjects/Specs.Unit/Business/GetBusinessesByKey.feature.cs
index bbd9139c..920c5a6f 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKey.feature.cs
+++ b/src/Subjects/Specs.Unit/Business/GetBusinessesByKey.feature.cs
@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
-namespace Goodtocode.Subjects.Unit.Business.Queries
+namespace Goodtocode.Subjects.Unit.Business
{
using TechTalk.SpecFlow;
using System;
@@ -37,7 +37,7 @@ public partial class FindBusinessesByKeyFeature
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business/Queries", "Find Businesses by key", "\tAs a customer service rep\r\n\tWhen I search for a business by key critera\r\n\tI can " +
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Find Businesses by key", "\tAs a customer service rep\r\n\tWhen I search for a business by key critera\r\n\tI can " +
"see a exact match for a business", ProgrammingLanguage.CSharp, featureTags);
testRunner.OnFeatureStart(featureInfo);
}
diff --git a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKeyStepDefinitions.cs b/src/Subjects/Specs.Unit/Business/GetBusinessesByKeyStepDefinitions.cs
similarity index 98%
rename from src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKeyStepDefinitions.cs
rename to src/Subjects/Specs.Unit/Business/GetBusinessesByKeyStepDefinitions.cs
index f1f7beaa..a49926aa 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByKeyStepDefinitions.cs
+++ b/src/Subjects/Specs.Unit/Business/GetBusinessesByKeyStepDefinitions.cs
@@ -7,7 +7,7 @@
using System.Collections.Concurrent;
using static Goodtocode.Subjects.Unit.Common.ResponseTypes;
-namespace Goodtocode.Subjects.Unit.Business.Queries;
+namespace Goodtocode.Subjects.Unit.Business;
[Binding]
[Scope(Tag = "getBusinessesByKey")]
@@ -68,7 +68,7 @@ public async Task WhenIQueryForMatchingBusinesses()
try
{
var handler = new GetBusinessQueryHandler(userBusinessesRepoMock.Object, Mapper);
- _response = await handler.Handle(request, CancellationToken.None);
+ _response = await handler.Handle(request, CancellationToken.None) ?? new BusinessEntity();
_responseType = CommandResponseType.Successful;
}
catch (Exception e)
diff --git a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByName.feature b/src/Subjects/Specs.Unit/Business/GetBusinessesByName.feature
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByName.feature
rename to src/Subjects/Specs.Unit/Business/GetBusinessesByName.feature
diff --git a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByName.feature.cs b/src/Subjects/Specs.Unit/Business/GetBusinessesByName.feature.cs
similarity index 96%
rename from src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByName.feature.cs
rename to src/Subjects/Specs.Unit/Business/GetBusinessesByName.feature.cs
index b33c646d..5abc1509 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Queries/GetBusinessesByName.feature.cs
+++ b/src/Subjects/Specs.Unit/Business/GetBusinessesByName.feature.cs
@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
-namespace Goodtocode.Subjects.Integration.Business.Queries
+namespace Goodtocode.Subjects.Unit.Business
{
using TechTalk.SpecFlow;
using System;
@@ -37,7 +37,7 @@ public partial class FindBusinessesByNameFeature
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business/Queries", "Find Businesses by name", "\tAs a customer service rep\r\n\tWhen I search for a business by name critera\r\n\tI can" +
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Find Businesses by name", "\tAs a customer service rep\r\n\tWhen I search for a business by name critera\r\n\tI can" +
" see a list of businesses that match the name criteria", ProgrammingLanguage.CSharp, featureTags);
testRunner.OnFeatureStart(featureInfo);
}
diff --git a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByNameStepDefinitions.cs b/src/Subjects/Specs.Unit/Business/GetBusinessesByNameStepDefinitions.cs
similarity index 97%
rename from src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByNameStepDefinitions.cs
rename to src/Subjects/Specs.Unit/Business/GetBusinessesByNameStepDefinitions.cs
index 8385cc8b..884f6628 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Queries/GetBusinessesByNameStepDefinitions.cs
+++ b/src/Subjects/Specs.Unit/Business/GetBusinessesByNameStepDefinitions.cs
@@ -7,7 +7,7 @@
using System.Collections.Concurrent;
using static Goodtocode.Subjects.Unit.Common.ResponseTypes;
-namespace Goodtocode.Subjects.Unit.Business.Queries;
+namespace Goodtocode.Subjects.Unit.Business;
[Binding]
[Scope(Tag = "getBusinessesByName")]
@@ -18,7 +18,7 @@ public class GetBusinessesByNameStepDefinitions : TestBase
private List _response = new();
private CommandResponseType _responseType;
private ValidationResult _validationErrors = new();
- private string _businessName = String.Empty;
+ private string _businessName = string.Empty;
private bool _businessExists;
[Given(@"I have a def ""([^""]*)""")]
diff --git a/src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommand.feature b/src/Subjects/Specs.Unit/Business/UpdateBusinessCommand.feature
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommand.feature
rename to src/Subjects/Specs.Unit/Business/UpdateBusinessCommand.feature
diff --git a/src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommand.feature.cs b/src/Subjects/Specs.Unit/Business/UpdateBusinessCommand.feature.cs
similarity index 96%
rename from src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommand.feature.cs
rename to src/Subjects/Specs.Unit/Business/UpdateBusinessCommand.feature.cs
index 6cf8ae41..37c0f5b4 100644
--- a/src/Subjects/Specs/Application.Integration/Business/Commands/UpdateBusinessCommand.feature.cs
+++ b/src/Subjects/Specs.Unit/Business/UpdateBusinessCommand.feature.cs
@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
-namespace Goodtocode.Subjects.Integration.Business.Commands
+namespace Goodtocode.Subjects.Unit.Business
{
using TechTalk.SpecFlow;
using System;
@@ -37,7 +37,7 @@ public partial class UpdateBusinessCommandFeature
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business/Commands", "Update Business Command", "As an customer service agent\r\nI can change business information\r\nAnd get the syst" +
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Business", "Update Business Command", "As an customer service agent\r\nI can change business information\r\nAnd get the syst" +
"em of record updated", ProgrammingLanguage.CSharp, featureTags);
testRunner.OnFeatureStart(featureInfo);
}
diff --git a/src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommandStepDefinitions.cs b/src/Subjects/Specs.Unit/Business/UpdateBusinessCommandStepDefinitions.cs
similarity index 98%
rename from src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommandStepDefinitions.cs
rename to src/Subjects/Specs.Unit/Business/UpdateBusinessCommandStepDefinitions.cs
index ccb5e26e..3b73086e 100644
--- a/src/Subjects/Specs/Application.Unit/Business/Commands/Update/UpdateBusinessCommandStepDefinitions.cs
+++ b/src/Subjects/Specs.Unit/Business/UpdateBusinessCommandStepDefinitions.cs
@@ -6,7 +6,7 @@
using System.Collections.Concurrent;
using static Goodtocode.Subjects.Unit.Common.ResponseTypes;
-namespace Goodtocode.Subjects.Unit.Business.Commands.Update;
+namespace Goodtocode.Subjects.Unit.Business;
[Binding]
[Scope(Tag = "updateBusinessCommand")]
diff --git a/src/Subjects/Specs/Application.Unit/Common/ResponseTypes.cs b/src/Subjects/Specs.Unit/Common/ResponseTypes.cs
similarity index 91%
rename from src/Subjects/Specs/Application.Unit/Common/ResponseTypes.cs
rename to src/Subjects/Specs.Unit/Common/ResponseTypes.cs
index fd13d5c3..cb9c386d 100644
--- a/src/Subjects/Specs/Application.Unit/Common/ResponseTypes.cs
+++ b/src/Subjects/Specs.Unit/Common/ResponseTypes.cs
@@ -7,6 +7,7 @@ public enum CommandResponseType
Successful,
BadRequest,
NotFound,
+ Conflict,
Error
}
}
diff --git a/src/Subjects/Specs/Application.Unit/ImplicitUsings.cs b/src/Subjects/Specs.Unit/ImplicitUsings.cs
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/ImplicitUsings.cs
rename to src/Subjects/Specs.Unit/ImplicitUsings.cs
diff --git a/src/Subjects/Specs/Application.Unit/Application.Unit.csproj b/src/Subjects/Specs.Unit/Specs.Unit.csproj
similarity index 62%
rename from src/Subjects/Specs/Application.Unit/Application.Unit.csproj
rename to src/Subjects/Specs.Unit/Specs.Unit.csproj
index d639d0b6..549e1013 100644
--- a/src/Subjects/Specs/Application.Unit/Application.Unit.csproj
+++ b/src/Subjects/Specs.Unit/Specs.Unit.csproj
@@ -9,12 +9,6 @@
enable
false
-
-
-
-
-
-
@@ -28,7 +22,7 @@
-
+
@@ -36,26 +30,40 @@
-
+
+ AddBusinessCommand.feature
+
+
+ DeleteBusinessCommand.feature
+
+
UpdateBusinessCommand.feature
-
+
GetBusinessesByKey.feature
-
+
GetBusinessesByName.feature
-
+
+ $(UsingMicrosoftNETSdk)
+ %(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
+
+
+ $(UsingMicrosoftNETSdk)
+ %(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
+
+
$(UsingMicrosoftNETSdk)
%(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
-
+
$(UsingMicrosoftNETSdk)
%(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
-
+
$(UsingMicrosoftNETSdk)
%(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)
diff --git a/src/Subjects/Specs/Application.Unit/TestBase.cs b/src/Subjects/Specs.Unit/TestBase.cs
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/TestBase.cs
rename to src/Subjects/Specs.Unit/TestBase.cs
diff --git a/src/Subjects/Specs.Unit/Usings.cs b/src/Subjects/Specs.Unit/Usings.cs
new file mode 100644
index 00000000..e69de29b
diff --git a/src/Subjects/Specs/Application.Unit/appsettings.test.json b/src/Subjects/Specs.Unit/appsettings.test.json
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/appsettings.test.json
rename to src/Subjects/Specs.Unit/appsettings.test.json
diff --git a/src/Subjects/Specs/Application.Unit/favicon.ico b/src/Subjects/Specs.Unit/favicon.ico
similarity index 100%
rename from src/Subjects/Specs/Application.Unit/favicon.ico
rename to src/Subjects/Specs.Unit/favicon.ico
diff --git a/src/Subjects/Specs.Unit/storeicon.png b/src/Subjects/Specs.Unit/storeicon.png
new file mode 100644
index 00000000..9b3a8ab3
Binary files /dev/null and b/src/Subjects/Specs.Unit/storeicon.png differ
diff --git a/src/Subjects/Specs/Application.Integration/Common/ContextSeeder.cs b/src/Subjects/Specs/Application.Integration/Common/ContextSeeder.cs
deleted file mode 100644
index b169bc96..00000000
--- a/src/Subjects/Specs/Application.Integration/Common/ContextSeeder.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Goodtocode.Subjects.Application;
-using Goodtocode.Subjects.Domain;
-
-namespace Goodtocode.Subjects.Integration.Common;
-internal class ContextSeeder : IContextSeeder
-{
- public async Task SeedSampleDataAsync(ISubjectsDbContext context)
- {
- await context.Business.AddRangeAsync(new List {
- new BusinessEntity()
- {
- BusinessKey = new Guid("2016a497-e56c-4be8-8ef6-3dc5ae1699ce"),
- BusinessName = "BusinessInDb",
- TaxNumber = "123-45678"
- },
- new BusinessEntity()
- {
- BusinessKey = new Guid("d1604a05-f883-40f1-803b-8562b5674f1a"),
- BusinessName = "BusinessInDb",
- TaxNumber = "123-45678"
- }
- }
- );
-
- await context.SaveChangesAsync(CancellationToken.None);
- }
-}