public void Test_InDirectory_Fail()
        {
            using (HttpServer server = HttpServer.Create())
            {
                Assert.AreEqual(null, server.InDirectory);

                server.PortNo = 4430;
                server.Start();
                Assert.AreEqual(null, server.InDirectory);

                server.Stop();
                Assert.AreEqual(null, server.InDirectory);
            }
        }
Example #2
0
 public void Test_Get_Success_1File_Range_Begin()
 {
     using (HttpServer server = HttpServer.Create())
         using (HttpClient client = new HttpClient())
         {
             server.PortNo       = 4430;
             server.OutDirectory = outDirectory;
             server.Start();
             client.DefaultRequestHeaders.Add("Range", "bytes=3-");
             var result = client.GetAsync(uri_hello).Result;
             // assert
             ServerAssert.GetResultEqual(HttpStatusCode.PartialContent, "lo, world.", result);
         }
 }
        public void Test_InDirectory_Success()
        {
            using (HttpServer server = HttpServer.Create())
            {
                server.InDirectory = inDirectory;
                Assert.AreEqual(inDirectory, server.InDirectory);

                server.PortNo = 4430;
                server.Start();
                Assert.AreEqual(inDirectory, server.InDirectory);

                server.Stop();
                Assert.AreEqual(inDirectory, server.InDirectory);
            }
        }