public void ensureRemovingValidCustomizedProductRemovesCustomizedProduct() { CatalogueCollection catalogueCollection = buildCatalogueCollection(); CustomizedProduct customizedProduct = buildCustomizedProduct("1234"); catalogueCollection.removeCustomizedProduct(customizedProduct); Assert.False(catalogueCollection.hasCustomizedProduct(customizedProduct)); Assert.Single(catalogueCollection.catalogueCollectionProducts); }
public void ensureCreatingCatalogueCollectionWithCustomizedProductCollectionAddsAllCustomizedProducts() { CustomizedProductCollection customizedProductCollection = new CustomizedProductCollection("Closets Spring 2019"); CustomizedProduct customizedProduct1 = buildCustomizedProduct("1234"); customizedProduct1.finalizeCustomization(); //!customized products added to collections need to be finished customizedProductCollection.addCustomizedProduct(customizedProduct1); CustomizedProduct customizedProduct2 = buildCustomizedProduct("1235"); customizedProduct2.finalizeCustomization(); //!customized products added to collections need to be finished customizedProductCollection.addCustomizedProduct(customizedProduct2); CatalogueCollection catalogueCollection = new CatalogueCollection(customizedProductCollection); Assert.True(catalogueCollection.hasCustomizedProduct(customizedProduct1)); Assert.True(catalogueCollection.hasCustomizedProduct(customizedProduct2)); }
public void ensureAddingCustomizedProductNotAddedTocustomizedProductCollectionDoesNotAddCustomizedProduct() { CatalogueCollection catalogueCollection = buildCatalogueCollection(); CustomizedProduct customizedProduct = buildCustomizedProduct("12345"); try { catalogueCollection.addCustomizedProduct(customizedProduct); } catch (Exception) { } Assert.Equal(2, catalogueCollection.catalogueCollectionProducts.Count); Assert.False(catalogueCollection.hasCustomizedProduct(customizedProduct)); }
public void ensureAddingValidCustomizedProductAddsCustomizedProduct() { CatalogueCollection catalogueCollection = buildCatalogueCollection(); CustomizedProductCollection customizedProductCollection = catalogueCollection.customizedProductCollection; CustomizedProduct customizedProduct = buildCustomizedProduct("123545"); customizedProduct.finalizeCustomization(); customizedProductCollection.addCustomizedProduct(customizedProduct); catalogueCollection.addCustomizedProduct(customizedProduct); Assert.Equal(3, catalogueCollection.catalogueCollectionProducts.Count); Assert.True(catalogueCollection.hasCustomizedProduct(customizedProduct)); }