GetSettingsAsync() 공개 메소드

public GetSettingsAsync ( string account, string workspace, SandboxCollection sandboxes, CancellationToken cancellationToken ) : Task
account string
workspace string
sandboxes SandboxCollection
cancellationToken System.Threading.CancellationToken
리턴 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);
        }