Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gladysheva committed Feb 12, 2024
1 parent 1b01a4e commit d989159
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,29 @@ public void Should_delete_application_from_cache_if_app_and_env_nodes_were_delet
[Test]
public void Should_not_delete_application_from_cache_when_env_exists_and_observation_of_deleted_apps_is_disabled()
{
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: true))
{
var expectedTopology = ServiceTopology.Build(new Uri[0], new Dictionary<string, string> {{"key", "1/1"}});
ShouldReturnImmediately(
storage,
"environment1",
"application1",
environment,
app,
expectedTopology);

DeleteApplicationNode("environment1", "application1");
envStorage.Get(environment).Should().BeEquivalentTo(new EnvironmentInfo(environment, null, null));

DeleteApplicationNode(environment, app);

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();
}
}

Expand All @@ -291,7 +295,7 @@ public void Should_not_delete_application_from_cache_when_observation_of_deleted
expectedTopology);

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

Ensemble.Stop();

envStorage.UpdateAll();
Expand Down

0 comments on commit d989159

Please sign in to comment.