예제 #1
0
        public async Task GetProxyReturnsAProxy()
        {
            //Arrange
            var proxyService = new ProxyService();

            //Act
            var proxy = await proxyService.GetProxy();

            //Assert
            Assert.IsTrue(proxy.Host != null && proxy.Port != 0);
        }
예제 #2
0
 public ApiResult <Proxy> One()
 {
     try
     {
         var proxy = proxyService.GetProxy();
         return(new ApiResult <Proxy>()
         {
             Status = true, Message = "ok", Result = proxy
         });
     }
     catch (Exception ex)
     {
         return(new ApiResult <Proxy>()
         {
             Status = false, Message = ex.Message
         });
     }
 }