/// <summary> /// <c>BasicClient</c> constructor. /// </summary> /// <param name="host">The hostname of the InSites server.</param> /// <param name="username">A username associated with an InSites login.</param> /// <param name="password">The password of the specified user.</param> public APIClient(UriScheme scheme, string host, string username, string password, int port) { Byte[] byteAuthorizationToken = System.Text.Encoding.ASCII.GetBytes(username + ":" + password); this.authHeaderValue = Convert.ToBase64String(byteAuthorizationToken); this.hostIP = host; this.scheme = scheme.ToString().ToLower(); this.sessionCookie = string.Empty; }
public void ToStringReturnsCorrectResult() { // Fixture setup string expected = "http"; var sut = new UriScheme("http"); // Exercise system var result = sut.ToString(); // Verify outcome Assert.Equal(expected, result); // Teardown }
public void ToStringReturnsCorrectResult() { // Arrange string expected = "http"; var sut = new UriScheme("http"); // Act var result = sut.ToString(); // Assert Assert.Equal(expected, result); }
internal static string ToScheme(this UriScheme scheme) { return(scheme.ToString().ToLower()); }
/// <summary> /// Gets the display name of a URI scheme. /// </summary> /// <param name="scheme">The URI scheme which to have its display name returned.</param> /// <returns>Returns the string-represented display name of the scheme.</returns> public static string GetUriSchemeDisplay(UriScheme scheme) { // Todo: Enhance the enum and make use of the read-only fields. return(string.Concat(scheme.ToString().ToLower(), ":")); }