Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gladysheva committed Feb 12, 2024
1 parent 19eec5a commit 1b01a4e
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void Should_not_delete_application_from_cache_when_env_exists_and_observa
CreateEnvironmentNode("environment1");
CreateApplicationNode("environment1", "application1", new Dictionary<string, string> {{"key", "1/1"}});

using (var storage = GetApplicationsStorage(out var envStorage, observeNonExistentApplications: false))
using (var storage = GetApplicationsStorage(out var envStorage, observeNonExistentApplications: true))
{
var expectedTopology = ServiceTopology.Build(new Uri[0], new Dictionary<string, string> {{"key", "1/1"}});
ShouldReturnImmediately(
Expand All @@ -276,25 +276,34 @@ public void Should_not_delete_application_from_cache_when_env_exists_and_observa
[Test]
public void Should_not_delete_application_from_cache_when_observation_of_deleted_apps_is_disabled_and_client_disconnected()
{
CreateEnvironmentNode("environment1");
CreateApplicationNode("environment1", "application1", new Dictionary<string, string> {{"key", "1/1"}});
var environment = "environment1";
var app = "application1";
CreateEnvironmentNode(environment);
CreateApplicationNode(environment, app, new Dictionary<string, string> {{"key", "1/1"}});

using (var storage = GetApplicationsStorage(out var envStorage, observeNonExistentApplications: false))
{
var expectedTopology = ServiceTopology.Build(new Uri[0], new Dictionary<string, string> {{"key", "1/1"}});
ShouldReturnImmediately(
storage,
"environment1",
"application1",
environment,
app,
expectedTopology);

envStorage.Get(environment).Should().BeEquivalentTo(new EnvironmentInfo(environment, null, null));

Ensemble.Stop();

envStorage.UpdateAll();
envStorage.Contains("environment1").Should().BeTrue();
envStorage.Contains(environment).Should().BeTrue();
storage.UpdateAll();

storage.Contains("environment1", "application1").Should().BeTrue();
storage.Contains(environment, app).Should().BeTrue();
ShouldReturnImmediately(
storage,
environment,
app,
expectedTopology);
}
}

Expand Down

0 comments on commit 1b01a4e

Please sign in to comment.