public GetSettingsAsync ( string account, string workspace, SandboxCollection sandboxes, |
||
account | string | |
workspace | string | |
sandboxes | SandboxCollection | |
cancellationToken | ||
return | Task |
public async Task Get_settings() { // Arrange var expected = new Settings(); var connector = Mock.Of<IWorkspacesConnector>() .ThatGetsJson("/acme/workspaces/cool/settings", expected); var client = new ExtendedWorkspacesClient(connector); // Act var response = await client.GetSettingsAsync("acme", "cool", null, None); // Assert response.ShouldBe(expected); }
public async Task Get_settings_with_sandbox() { // Arrange var expected = new Settings(); var expectedHeaders = new NameValueCollection { {"x-vtex-sandbox", "oscorp/tests=foo+bar"} }; var connector = Mock.Of<IWorkspacesConnector>() .ThatGetsJson("/acme/workspaces/cool/settings", expectedHeaders, expected); var client = new ExtendedWorkspacesClient(connector); var sandboxes = new SandboxCollection(new[] { new Sandbox("oscorp", "tests", new[] {"foo", "bar"}) }); // Act var response = await client.GetSettingsAsync("acme", "cool", sandboxes, None); // Assert response.ShouldBe(expected); }