public void CanAssociateProductsWithSupplier() {
            Supplier supplier = new Supplier("Acme");
            supplier.Products.Add(new Product("Strawberries", supplier));
            supplier.Products.Add(new Product("Apples", supplier));

            supplier.Products.Count.ShouldEqual(2);
        }
        public void CanCompareProducts() {
            Supplier supplierA = new Supplier("A");
            Supplier supplierB = new Supplier("B");

            (new Product("1", supplierA)).ShouldNotEqual(new Product("1", supplierB));
            (new Product("1", supplierA)).ShouldNotEqual(new Product("2", supplierB));
            (new Product("1", supplierA)).ShouldEqual(new Product("1", supplierA));
        }
 private Supplier CreateSupplierWithFewestProducts() {
     Supplier supplierWithMostProducts = new Supplier("Acme");
     supplierWithMostProducts.Products.Add(
         new Product() {
             ProductName = "Whatever"
         });
     return supplierWithMostProducts;
 }
        public void CanCreateProduct() {
            Supplier supplierOfProduct = new Supplier("Acme");
            Product product = new Product("Fruit", supplierOfProduct);

            Category categoryOfProduct = new Category("Good Stuff");
            product.Category = categoryOfProduct;

            product.ProductName.ShouldEqual("Fruit");
            product.Supplier.ShouldEqual(new Supplier("Acme"));
            product.Category.ShouldEqual(categoryOfProduct);
        }
 private Supplier CreateSupplierWithMostProducts() {
     Supplier supplierWithMostProducts = new Supplier("Codai");
     supplierWithMostProducts.Products.Add(
         new Product() {
             ProductName = "Training"
         });
     supplierWithMostProducts.Products.Add(
         new Product() {
             ProductName = "Consulting"
         });
     return supplierWithMostProducts;
 }
        public void CanCreateSupplier()
        {
            Supplier supplier = new Supplier("Acme");

            supplier.CompanyName.ShouldEqual("Acme");
        }
Beispiel #7
0
 /// <summary>
 /// Creates valid domain object
 /// </summary>
 public Product(string name, Supplier supplier) {
     Supplier = supplier;
     ProductName = name;
 }