Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
 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
 }
Beispiel #3
0
        public void ToStringReturnsCorrectResult()
        {
            // Arrange
            string expected = "http";
            var    sut      = new UriScheme("http");
            // Act
            var result = sut.ToString();

            // Assert
            Assert.Equal(expected, result);
        }
Beispiel #4
0
        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
        }
 internal static string ToScheme(this UriScheme scheme)
 {
     return(scheme.ToString().ToLower());
 }
Beispiel #6
0
 /// <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(), ":"));
 }