コード例 #1
0
        public void SetUp()
        {
            var json      = new JsonSerializer();
            var resources = new RetailerResources {
                Retailers = new[] { new RetailerResource(), new RetailerResource() }
            };

            this.response = new RestResponse <string> {
                StatusCode = HttpStatusCode.OK, Value = json.Serialize(resources)
            };

            this.RestClient.Get(
                Arg.Any <CancellationToken>(),
                Arg.Is <Uri>(u => u.ToString().Contains($"/retailers")),
                Arg.Any <IDictionary <string, string> >(),
                Arg.Any <IDictionary <string, string[]> >())
            .Returns(this.response);

            this.results = this.Sut.GetRetailers();
        }
コード例 #2
0
        public void SetUp()
        {
            var json     = new JsonSerializer();
            var resource = new RetailerResources {
                Retailers = new RetailerResource[0]
            };

            this.response = new RestResponse <string> {
                StatusCode = HttpStatusCode.OK, Value = json.Serialize(resource)
            };
            this.salesCustomerUri = "/sales/customers/808";

            this.RestClient.Get(
                Arg.Any <CancellationToken>(),
                Arg.Is <Uri>(u => u.ToString().Contains($"/retailers?salesCustomer={this.salesCustomerUri}")),
                Arg.Any <IDictionary <string, string> >(),
                Arg.Any <IDictionary <string, string[]> >())
            .Returns(this.response);

            this.RetailerId = this.Sut.GetRetailerId(this.salesCustomerUri);
        }