public void CreateWithNoAuth(string url) { var restClient = new AuthenticatedRestClient(url); Assert.That(restClient.AuthenticationToken, Is.Null); Assert.That(restClient.BaseUrl, Is.EqualTo("http://localhost")); // ensure trailing slashes are omitted }
public void CreateWithBothDefaultsToComposedAuthToken(string url, string authenticationToken) { var restClient = new AuthenticatedRestClient(url, authenticationToken); Assert.That(restClient.AuthenticationToken, Is.EqualTo("dXNlcjpwYXNzd29yZA==")); Assert.That(restClient.BaseUrl, Is.EqualTo("http://localhost")); // ensure trailing slashes are omitted }
public TeamCityApi(string server, string authToken = null) { _teamCityServer = server; _client = new AuthenticatedRestClient(TeamCityServer, authToken); var builder = new UriBuilder(_client.BaseUrl) { Path = string.IsNullOrEmpty(this._client.AuthenticationToken) ? "guestAuth" : "httpAuth" }; _client.BaseUrl = builder.ToString(); }
public void CreateWithNoAuth(string url) { var restClient = new AuthenticatedRestClient(url); Assert.That(restClient.AuthenticationToken, Is.Null); Assert.That(restClient.BaseUrl, Is.EqualTo("http://localhost")); // ensure trailing slashes are omitted }
public void CreateWithComposedAuth(string url, string authenticationToken) { var restClient = new AuthenticatedRestClient(url, authenticationToken); Assert.That(restClient.AuthenticationToken, Is.EqualTo("dXNlcjpwYXNzd29yZA==")); Assert.That(restClient.BaseUrl, Is.EqualTo("http://localhost")); // ensure trailing slashes are omitted }