Question: Hello, I'm working on an assignment to where I need to create a Unit test in C# that will have the Functionalities that are required

Hello, I'm working on an assignment to where I need to create a Unit test in C# that will have the Functionalities that are required for the ShoppingCart class are as listed:

  • Adding Product
    • Make sure the unit test accurately tests the product and if it was added correctly.
  • Removing Product
    • Make sure the unit test accurately removes the product.
  • Getting Total
    • Create a unit test that checks to see if the total is accurate.

Below is a UML diagram of the software i created

Hello, I'm working on an assignment to where I need to create

  • Can you please help me create a Unit test in C#? Thank you.

Customer Product Shopping Cart Item StoreItem - Id: int - Id: int - Product Product Product Product - Name: string - Name: string - Quantity: int Quantity: int - Address : string Price: decimal > Storeltem(product : product, quantity :int) + Getid:int + Getid(): int + GetQuantity: int + Setld(id:int) + Setld(id:int) > ShopingCartItem(product : product, quantity :int) GetQuantity: int + SetQuantity (quantity : int) + GetProduct(): Product SetProduct(product : Product) + GetTotal(): decimal + SetQuantity (quantity: int) + GetProduct(): Product + GetName(): string + GetName() + SetName(name: string) + SetName(name: string) + SetProduct{product: Product) + GetAddress(): string + GetPrice(): decimal + SetAddress(address : string) + SetPrice(price : decimal) Store Shopping Cart - Id: int - Customer Customer - Name: string - Product 1: Shopping CartItem - Product 1: Product Product2: Shopping CartItem - Product2: Product - Product3: Shopping CartItem - Product3: Product Getld(): int Setid(id:int) + > Shopping Cart(cust: customer) + GetCustomerld(): int + AddProduct(prod : Product, quantity: int) : Shopping Cartitem + AddProduct(prod : Product): Shopping CartItem + Remove Product(prod : Product, quantity : int) : Shopping Cartitem + GetProductById(id:int): Shopping CartItem + GetName(): string + SetName(name: string) + AddStoreltem(prod : Product) + RemoveStoreltem(productNum : int) + GetStoreltem(productNum : int): Product + Get Total(): decimal + GetProduct(productNum : int): Shopping Cartitem + FindStoreltemByld(id:int): Product

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!