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