public void WhenSetValidZoneSettings_GetZoneSettingsReturnSameValues() { var baseKey = hkcu.CreateSubKey(TestKeyPath); var repository = new InventorySettingsRepository(baseKey); repository.SetProjectSettings(new ProjectSettings() { ProjectId = "pro-1" }); repository.SetZoneSettings("pro-1", new ZoneSettings() { ZoneId = "zone-1", Username = "******" }); Assert.AreEqual("user-1", repository.GetZoneSettings("pro-1", "zone-1").Username); }
public void WhenProjectSettingsDeleted_ZoneSettingsAreDeletedToo() { var baseKey = hkcu.CreateSubKey(TestKeyPath); var repository = new InventorySettingsRepository(baseKey); repository.SetProjectSettings(new ProjectSettings() { ProjectId = "pro-1" }); repository.SetZoneSettings("pro-1", new ZoneSettings() { ZoneId = "zone-1", Username = "******" }); repository.DeleteProjectSettings("pro-1"); Assert.Throws <KeyNotFoundException>(() => { repository.GetZoneSettings("pro-1", "zone-1"); }); }