コード例 #1
0
        public void you_can_update_an_existing_design_for_example_you_can_change_its_material()
        {
            var command = new DesignRepository(Internet, Settings.BaseUrl);

            var theDesign = ExampleProduct.Designs[0];
            var theOriginalMaterial = theDesign.MaterialKey;

            theDesign.MaterialKey = ExampleMaterials.SUPERFINE_PLASTIC;

            var result = command.Update(ExampleProduct.Key, theDesign);

            var theUpdatedDesign = result.Designs[0];

            Assert.AreEqual(ExampleMaterials.SUPERFINE_PLASTIC, theUpdatedDesign.MaterialKey,
                "Expected the design's material key to have been updated"
            );

            Assert.AreNotEqual(theOriginalMaterial, theUpdatedDesign.MaterialKey,
                "Expected the design's material key to have been changed from what it was"
            );
        }
コード例 #2
0
        public void you_can_only_change_the_file_name_when_uploading_a_new_design_file()
        {
            var command = new DesignRepository(Internet, Settings.BaseUrl);

            var theDesign = ExampleProduct.Designs[0];

            var theNewFile = new FileInfo("res\\another_bottom_new.stl");

            var result = command.Update(ExampleProduct.Key, theDesign, theNewFile);

            var theUpdatedDesign = result.Designs[0];

            Assert.AreEqual(theNewFile.Name, theUpdatedDesign.Filename, "Expected the filename to have been updated");
        }