예제 #1
0
        public static async Task RunAsync(string uri, string user, string pass)
        {
            var client = new HAsyncClient(new Uri(uri), user, pass);
            await client.OpenAsync();

            Console.WriteLine(await client.GetStringAsync("about", new Dictionary <string, string>(), "text/zinc"));
            Console.ReadKey();
        }
예제 #2
0
 public async Task BadPassTest()
 {
     var client = new HAsyncClient(_uri,
                                   new AsyncAuthClientContext(_uri, _user, "badpass")
     {
         ServerCallAsync = new MockServerCallBuilder().WithFailingLogin().Build(),
     });
     await client.OpenAsync();
 }
예제 #3
0
 public async Task LoginTest()
 {
     var client = new HAsyncClient(_uri,
                                   new AsyncAuthClientContext(_uri, _user, _pass)
     {
         ServerCallAsync = new MockServerCallBuilder().Build(),
     });
     await client.OpenAsync();
 }
예제 #4
0
        public async Task Read()
        {
            var client = new HAsyncClient(_uri,
                                          new AsyncAuthClientContext(_uri, _user, _pass)
            {
                ServerCallAsync = new MockServerCallBuilder()
                                  .WithReadResponse(_oneSiteZinc)
                                  .Build(),
            });
            await client.OpenAsync();

            await client.readAsync("site", true);
        }