public async Task GetPackagesServerInfo()
        {
            var client = new Mock <ISynoWebApi>();

            client.Setup(c => c.ExecuteAsync <SynologyResponse <SynologyPackageServer> >(It.IsAny <IRestRequest>()))
            .ReturnsAsync(new RestResponse <SynologyResponse <SynologyPackageServer> >()
            {
                Data = new SynologyResponse <SynologyPackageServer>()
                {
                    Data = new SynologyPackageServer()
                }
            });

            var c      = new SynoPackageServerClient(client.Object);
            var result = await c.GetPackagesServerInfo();

            Assert.IsNotNull(result);
        }
        public async Task Resource()
        {
            var client = new Mock <ISynoWebApi>();

            client.Setup(c => c.ExecuteAsync <SynologyResponse <SynologyPackageServer> >(It.IsAny <IRestRequest>()))
            .ReturnsAsync(new RestResponse <SynologyResponse <SynologyPackageServer> >()
            {
                Data = new SynologyResponse <SynologyPackageServer>()
                {
                    Data = new SynologyPackageServer()
                }
            });

            var c      = new SynoPackageServerClient(client.Object);
            var result = await c.GetPackagesServerInfo();

            client.Verify(c => c.ExecuteAsync <SynologyResponse <SynologyPackageServer> >(It.Is <SynologyRestRequest>(arg =>
                                                                                                                      arg.Resource == "/entry.cgi")));
        }
        public async Task ServiceApiName()
        {
            var client = new Mock <ISynoWebApi>();



            client.Setup(c => c.ExecuteAsync <SynologyResponse <SynologyPackageServer> >(It.IsAny <IRestRequest>()))
            .ReturnsAsync(new RestResponse <SynologyResponse <SynologyPackageServer> >()
            {
                Data = new SynologyResponse <SynologyPackageServer>()
                {
                    Data = new SynologyPackageServer()
                }
            });

            var c      = new SynoPackageServerClient(client.Object);
            var result = await c.GetPackagesServerInfo();

            client.Verify(c => c.ExecuteAsync <SynologyResponse <SynologyPackageServer> >(It.Is <SynologyRestRequest>(arg =>
                                                                                                                      arg.Parameters.Any(p => p.Value != null && p.Value.ToString() == "SYNO.Core.Package.Server"))));
        }