public void SetUp()
 {
     api = new TestDuoApi(test_ikey, test_skey, test_host);
     srv = new TestServer(test_ikey, test_skey);
     srvThread = new Thread(srv.Run);
     srvThread.Start();
 }
Example #2
0
 public void SetUp()
 {
     api       = new TestDuoApi(test_ikey, test_skey, test_host);
     srv       = new TestServer(test_ikey, test_skey);
     srvThread = new Thread(srv.Run);
     srvThread.Start();
 }
    public void TestCustomUserAgent()
    {
        api = new TestDuoApi(test_ikey, test_skey, test_host, "CustomUserAgent/1.0");
        srv.handler = delegate(HttpListenerContext ctx)
        {
            return ctx.Request.UserAgent;
        };

        HttpStatusCode code;
        string response = api.ApiCall("GET", "/CustomUserAgent", new Dictionary<string, string>(), 10000, out code);
        Assert.AreEqual(code, HttpStatusCode.OK);
        Assert.AreEqual("CustomUserAgent/1.0", response);
    }
Example #4
0
    public void TestCustomUserAgent()
    {
        api         = new TestDuoApi(test_ikey, test_skey, test_host, "CustomUserAgent/1.0");
        srv.handler = delegate(HttpListenerContext ctx)
        {
            return(ctx.Request.UserAgent);
        };

        HttpStatusCode code;
        string         response = api.ApiCall("GET", "/CustomUserAgent", new Dictionary <string, string>(), 10000, out code);

        Assert.AreEqual(code, HttpStatusCode.OK);
        Assert.AreEqual("CustomUserAgent/1.0", response);
    }