Beispiel #1
0
        public void GetSingleProducts()
        {
            var response = Products.GetProduct("TST");

            response.StatusCode.Should().Be(HttpStatusCode.OK);
            var products = JsonConvert.DeserializeObject <ProductsObject>(response.Content);

            products.Items.Count.Should().Be(1, $"Expected number of products 1, but got { products.Items.Count}");
            products.Items[0].ProductCode.Should().Be("TST");
            products.Items[0].ProductDescription.Should().Be("Test product");
        }
Beispiel #2
0
        public void ThenANewProductIsCreated(string productCode)
        {
            var response = Products.GetProduct(productCode);

            response.StatusCode.Should().Be(HttpStatusCode.OK);
            var products = JsonConvert.DeserializeObject <ProductsObject>(response.Content);

            products.Items.Count.Should().Be(1, $"A single product with name is expected. Found {products.Items.Count} products");
        }