From 70abdc3339fa74b235884644e6071e6f170dcee0 Mon Sep 17 00:00:00 2001 From: Richard Safier Date: Sun, 24 Mar 2024 21:15:06 -0400 Subject: [PATCH] formatting --- .../Fixture/PostgresLightningFixture.cs | 18 +++++++++--------- LNUnit.Tests/PostgresLightningScenario.cs | 4 ++-- LNUnit/Setup/LNUnitBuilder.cs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/LNUnit.Tests/Fixture/PostgresLightningFixture.cs b/LNUnit.Tests/Fixture/PostgresLightningFixture.cs index 8a5b847..6029768 100644 --- a/LNUnit.Tests/Fixture/PostgresLightningFixture.cs +++ b/LNUnit.Tests/Fixture/PostgresLightningFixture.cs @@ -14,14 +14,14 @@ namespace LNUnit.Fixtures; // ReSharper disable once ClassNeverInstantiated.Global public class PostgresLightningFixture : IDisposable { - public string DbContainerName { get; set; }= "postgres"; + public string DbContainerName { get; set; } = "postgres"; private readonly DockerClient _client = new DockerClientConfiguration().CreateClient(); private string _containerId; private string _ip; public PostgresLightningFixture() { - StartPostgres().Wait(); + StartPostgres().Wait(); AddDb("alice"); AddDb("bob"); AddDb("carol"); @@ -38,7 +38,7 @@ private void AddDb(string dbName) if (result == null) { - + using var command = new NpgsqlCommand($"CREATE DATABASE \"{dbName}\"", connection); command.ExecuteNonQuery(); } @@ -56,7 +56,7 @@ public void Dispose() GC.SuppressFinalize(this); // Remove containers - RemoveContainer(DbContainerName).Wait(); + RemoveContainer(DbContainerName).Wait(); RemoveContainer("miner").Wait(); RemoveContainer("alice").Wait(); RemoveContainer("bob").Wait(); @@ -67,7 +67,7 @@ public void Dispose() } public LNUnitBuilder? Builder { get; private set; } - + public async Task SetupNetwork() { @@ -88,7 +88,7 @@ public async Task SetupNetwork() ChannelSize = 10_000_000, //10MSat RemoteName = "bob" } - ], imageName: "custom_lnd", tagName: "latest", pullImage: false,postgresDSN: LNDConnectionStrings["alice"]); + ], imageName: "custom_lnd", tagName: "latest", pullImage: false, postgresDSN: LNDConnectionStrings["alice"]); Builder.AddPolarLNDNode("bob", [ @@ -98,7 +98,7 @@ public async Task SetupNetwork() RemotePushOnStart = 1_000_000, // 1MSat RemoteName = "alice" } - ], imageName: "custom_lnd", tagName: "latest", pullImage: false,postgresDSN: LNDConnectionStrings["bob"]); + ], imageName: "custom_lnd", tagName: "latest", pullImage: false, postgresDSN: LNDConnectionStrings["bob"]); Builder.AddPolarLNDNode("carol", [ @@ -114,11 +114,11 @@ public async Task SetupNetwork() RemotePushOnStart = 1_000_000, // 1MSat RemoteName = "bob" } - ], imageName: "custom_lnd", tagName: "latest", pullImage: false,postgresDSN: LNDConnectionStrings["carol"]); + ], imageName: "custom_lnd", tagName: "latest", pullImage: false, postgresDSN: LNDConnectionStrings["carol"]); await Builder.Build(); } - + public async Task StartPostgres() { await _client.PullImageAndWaitForCompleted("postgres", "16.2-alpine"); diff --git a/LNUnit.Tests/PostgresLightningScenario.cs b/LNUnit.Tests/PostgresLightningScenario.cs index 561eb34..73a5932 100644 --- a/LNUnit.Tests/PostgresLightningScenario.cs +++ b/LNUnit.Tests/PostgresLightningScenario.cs @@ -24,14 +24,14 @@ public PostgresXUnitTest(PostgresLightningFixture fixture, ITestOutputHelper out Console.SetOut(new TestOutputWriter(output)); } - + [Fact] public async Task Verify_Alice_Bob_Carol_Setup() { var readyNodes = _lightningRegtestNetworkFixture.Builder!.LNDNodePool!.ReadyNodes.ToImmutableList(); var nodeCount = readyNodes.Count; - Assert.AreEqual(3, nodeCount); + Assert.That(nodeCount, Is.EqualTo(3)); $"LND Nodes in Ready State: {nodeCount}".Print(); foreach (var node in readyNodes) { diff --git a/LNUnit/Setup/LNUnitBuilder.cs b/LNUnit/Setup/LNUnitBuilder.cs index 27fbbac..35b565b 100644 --- a/LNUnit/Setup/LNUnitBuilder.cs +++ b/LNUnit/Setup/LNUnitBuilder.cs @@ -270,7 +270,7 @@ await _dockerClient.Containers.StartContainerAsync(loopServer?.ID, inspectionResponse = await _dockerClient.Containers.InspectContainerAsync(n.DockerContainerId); ipAddress = inspectionResponse.NetworkSettings.Networks.First().Value.IPAddress; } - + var basePath = !n.Image.Contains("lightning-terminal") ? "/home/lnd/.lnd" : "/root/lnd/.lnd"; if (n.Image.Contains("lightning-terminal")) await Task.Delay(2000); var txt = await GetStringFromFS(n.DockerContainerId, $"{basePath}/tls.cert");