Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shared.EventStore" Version="2025.11.1" />
<PackageReference Include="Shared.EventStore" Version="2025.11.11" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="13.1.0" />
<PackageReference Include="Shared" Version="2025.11.1" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.11.1" />
<PackageReference Include="Shared.EventStore" Version="2025.11.1" />
<PackageReference Include="Shared" Version="2025.11.11" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.11.11" />
<PackageReference Include="Shared.EventStore" Version="2025.11.11" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CallbackHandler.CallbackMessageAggregate\CallbackHandler.CallbackMessageAggregate.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<DebugType>None</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Shared" Version="2025.11.1" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.11.1" />
<PackageReference Include="Shared" Version="2025.11.11" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.11.11" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Shared.EventStore" Version="2025.11.1" />
<PackageReference Include="Shared.EventStore" Version="2025.11.11" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
<PackageReference Include="Shared" Version="2025.11.1" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.11.1" />
<PackageReference Include="Shared.EventStore" Version="2025.11.1" />
<PackageReference Include="Shared" Version="2025.11.11" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.11.11" />
<PackageReference Include="Shared.EventStore" Version="2025.11.11" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Shared" Version="2025.11.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.11.1" />
<PackageReference Include="Shared" Version="2025.11.11" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.11.11" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion CallbackHandler.IntegrationTests/Common/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace CallbackHandler.IntegrationTests.Common;

public class CallbackHandlerDockerHelper : global::Shared.IntegrationTesting.DockerHelper
public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.DockerHelper
{
public override async Task CreateSubscriptions()
{
Expand Down
6 changes: 2 additions & 4 deletions CallbackHandler.IntegrationTests/Common/GenericSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,18 @@
String scenarioName = this.ScenarioContext.ScenarioInfo.Title.Replace(" ", "");
NlogLogger logger = new();
logger.Initialise(LogManager.GetLogger(scenarioName), scenarioName);
LogManager.AddHiddenAssembly(typeof(NlogLogger).Assembly);

Check warning on line 30 in CallbackHandler.IntegrationTests/Common/GenericSteps.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

'LogManager.AddHiddenAssembly(Assembly)' is obsolete: 'Replaced by LogManager.Setup().SetupLogFactory(setup => setup.AddCallSiteHiddenAssembly(assembly)). Marked obsolete on NLog 5.3'

Check warning on line 30 in CallbackHandler.IntegrationTests/Common/GenericSteps.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

'LogManager.AddHiddenAssembly(Assembly)' is obsolete: 'Replaced by LogManager.Setup().SetupLogFactory(setup => setup.AddCallSiteHiddenAssembly(assembly)). Marked obsolete on NLog 5.3'

DockerServices dockerServices = DockerServices.CallbackHandler | DockerServices.EventStore | DockerServices.SqlServer;

this.TestingContext.DockerHelper = new CallbackHandlerDockerHelper();
this.TestingContext.DockerHelper = new DockerHelper();
this.TestingContext.DockerHelper.Logger = logger;
this.TestingContext.Logger = logger;
this.TestingContext.DockerHelper.RequiredDockerServices = dockerServices;
this.TestingContext.Logger.LogInformation("About to Start Global Setup");

await Setup.GlobalSetup(this.TestingContext.DockerHelper);

this.TestingContext.DockerHelper.SqlServerContainer = Setup.DatabaseServerContainer;
this.TestingContext.DockerHelper.SqlServerNetwork = Setup.DatabaseServerNetwork;
this.TestingContext.DockerHelper.DockerCredentials = Setup.DockerCredentials;
this.TestingContext.DockerHelper.SqlCredentials = Setup.SqlCredentials;
this.TestingContext.DockerHelper.SqlServerContainerName = "sharedsqlserver";
Expand All @@ -56,7 +54,7 @@
[AfterScenario()]
public async Task StopSystem()
{
DockerServices dockerSharedServices = DockerServices.SqlServer;
DockerServices dockerSharedServices = DockerServices.None;

this.TestingContext.Logger.LogInformation("About to Stop Containers for Scenario Run");
await this.TestingContext.DockerHelper.StopContainersForScenarioRun(dockerSharedServices).ConfigureAwait(false);
Expand Down
29 changes: 1 addition & 28 deletions CallbackHandler.IntegrationTests/Common/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,11 @@ namespace CallbackHandler.IntegrationTests.Common;
[Binding]
public class Setup
{
public static IContainerService DatabaseServerContainer;
public static INetworkService DatabaseServerNetwork;
public static (String usename, String password) SqlCredentials = ("sa", "thisisalongpassword123!");
public static (String url, String username, String password) DockerCredentials = ("https://www.docker.com", "stuartferguson", "Sc0tland");

static object padLock = new object(); // Object to lock on


public static async Task GlobalSetup(DockerHelper dockerHelper)
{
ShouldlyConfiguration.DefaultTaskTimeout = TimeSpan.FromMinutes(1);
dockerHelper.SqlCredentials = Setup.SqlCredentials;
dockerHelper.DockerCredentials = Setup.DockerCredentials;
dockerHelper.SqlServerContainerName = "sharedsqlserver";

lock (Setup.padLock)
{
Setup.DatabaseServerNetwork = dockerHelper.SetupTestNetwork("sharednetwork");

dockerHelper.Logger.LogInformation("in start SetupSqlServerContainer");
Setup.DatabaseServerContainer = dockerHelper.SetupSqlServerContainer(Setup.DatabaseServerNetwork).Result;
}
}

public static String GetConnectionString(String databaseName)
{
return $"server={Setup.DatabaseServerContainer.Name};database={databaseName};user id={Setup.SqlCredentials.usename};password={Setup.SqlCredentials.password}&Encrypt=false";
}

public static String GetLocalConnectionString(String databaseName)
{
Int32 databaseHostPort = Setup.DatabaseServerContainer.ToHostExposedEndpoint("1433/tcp").Port;

return $"server=localhost,{databaseHostPort};database={databaseName};user id={Setup.SqlCredentials.usename};password={Setup.SqlCredentials.password}&Encrypt=false";
}
}
2 changes: 1 addition & 1 deletion CallbackHandler.IntegrationTests/Common/TestingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

public class TestingContext
{
public CallbackHandlerDockerHelper DockerHelper { get; set; }
public DockerHelper DockerHelper { get; set; }
public NlogLogger Logger { get; set; }

public List<Deposit> Deposits { get; set; }

public Dictionary<Guid, String> SentCallbacks { get; set; }

public TestingContext()

Check warning on line 15 in CallbackHandler.IntegrationTests/Common/TestingContext.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

Non-nullable property 'Deposits' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 15 in CallbackHandler.IntegrationTests/Common/TestingContext.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

Non-nullable property 'Logger' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 15 in CallbackHandler.IntegrationTests/Common/TestingContext.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

Non-nullable property 'DockerHelper' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 15 in CallbackHandler.IntegrationTests/Common/TestingContext.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

Non-nullable property 'Deposits' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 15 in CallbackHandler.IntegrationTests/Common/TestingContext.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

Non-nullable property 'Logger' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 15 in CallbackHandler.IntegrationTests/Common/TestingContext.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

Non-nullable property 'DockerHelper' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
this.SentCallbacks = new Dictionary<Guid, string>();
}
Expand Down
4 changes: 2 additions & 2 deletions CallbackHandler/CallbackHandler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageReference Include="MediatR" Version="13.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Shared" Version="2025.11.1" />
<PackageReference Include="Shared.Results.Web" Version="2025.11.1" />
<PackageReference Include="Shared" Version="2025.11.11" />
<PackageReference Include="Shared.Results.Web" Version="2025.11.11" />
<PackageReference Include="SimpleResults.AspNetCore" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="9.0.6" />
Expand Down
Loading