public void SetUp()
 {
     AnyProduct = NewProduct("Example for testing assembly instructions");
 }
Пример #2
0
 public void TestFixtureSetUp()
 {
     DesignImageRepository = new DesignImageRepository(Internet, Settings.BaseUrl);
     AnyProduct = NewProduct("Example for testing design images");
 }
        private Order CreateANewOrder(Product product)
        {
            var command = new OrderRepository(Internet, Settings.BaseUrl);

            var reference = Guid.NewGuid().ToString();

            var shippingInfo = new ProductShippingInfo() { Key = product.Key, Quantity = 1};

            return command.Create(reference, AnyShippingOption(shippingInfo), ExampleShippingAddress, shippingInfo);
        }
 private void RefreshProduct()
 {
     Delete(AnyProduct);
     AnyProduct = NewProduct("Example for testing assembly instructions");
 }
 protected void AssertIncludesDesignImage(Product product, File file)
 {
     Assert.IsTrue(product.DesignImages.Exists(it => it.Filename == file.Filename),
         "The design image <{0}> is not present", file.Filename
     );
 }
 public void TestFixtureSetUp()
 {
     AnyProduct = NewProduct("At least one for testing find");
 }
 protected void AssertIncludesAssemblyInstructions(Product product, File file)
 {
     Assert.IsTrue(product.AssemblyInstructions.Exists(it => it.Filename == file.Filename),
         "The assembly instructions file <{0}> is not present", file.Filename
     );
 }
Пример #8
0
 public void BeforeEach()
 {
     HardwareRepository = new HardwareRepository(Internet, Settings.BaseUrl);
     AnyProduct = NewProduct("Example for testing hardware");
 }
 protected void Delete(Product product)
 {
     un.less(null == product, () => new DeleteCommand(Internet, Settings.BaseUrl).Delete(product.Key));
 }
        public void you_can_delete_a_design()
        {
            var theLastDesign = ExampleProduct.Designs[0];
            var addNewDesign = new DesignRepository(Internet, Settings.BaseUrl);

            ExampleProduct = addNewDesign.Add(ExampleProduct.Key, NewDesign());

            Assert.AreEqual(2, ExampleProduct.Designs.Count,
                "Invalid test data" +
                "In order for this test to be valid, the product needs to have " +
                "more than one design (since you can't delete the last one)"
            );

            var command = new DesignRepository(Internet, Settings.BaseUrl);

            var theRefreshedProduct = command.Delete(ExampleProduct.Key, ExampleProduct.Designs[1].Key);

            Assert.AreEqual(1, theRefreshedProduct.Designs.Count, "Expected the design to have been deleted");
            Assert.AreEqual(theLastDesign.Key, theRefreshedProduct.Designs[0].Key, "Expected that the newly-added one was deleted");
        }
 public void SetUp()
 {
     ExampleProduct = NewProduct("A product to update");
 }