Skip to content

catperso/pizza-parlor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chef Epicodi's Pizza Parlor

By Matt C.

Mock website to add/remove pizzas from an order

Technologies Used

  • HTML
  • CSS
  • Markdown
  • JavaScript
  • Bootstrap
  • jQuery

Description

Uses objects to store pizzas you create and add to your order, which you can then view or remove from the order.

Setup/Installation Requirements

  • Clone this repository to your local device
  • Run index.html in your browser
  • Enjoy the lovely CSS
  • Or experience the site live on github pages right here!

Known Bugs

  • Cannot actually order the pizzas yet.

License - MIT

If you run into any problems/bugs feel free to send me an email @mc.casperson@gmail.com with details.

Copyright (c) 2021 Matt C.

SPECS


Describe: Pizza()

Test: "It should return a Pizza object with four properties for Toppings, Size, Sauce, and Crust."

  • Code: const myPizza = new Pizza(["canadian bacon", "pineapple", "pepperoncini"], "medium", "garlic parmesan", "stuffed");
  • Expected Output: Pizza { toppings: ["canadian bacon", "pineapple", "pepperoncini"], size: "medium", sauce: "garlic parmesan", crust: "stuffed" }

Describe: Pizza.prototype.pricing()

Test: "It should set a price property for the pizza its called on based on the other properties."

  • Code: myPizza.pricing();
  • Expected Output: Pizza { toppings: ["canadian bacon", "pineapple", "pepperoncini"], size: "medium", sauce: "garlic parmesan", crust: "stuffed", price: 12.75 }

Describe: PizzaOrder()

Test: "It should return a PizzaOrder object with a property to store pizzas and an ID to assign pizzas it stores."

  • Code: const myOrder = new PizzaOrder();
  • Expected Output: PizzaOrder { Pizzas: {}, currentId: 0 }

Describe: PizzaOrder.prototype.addPizza(pizza)

Test: "It should assign an ID to a pizza and add it to the order."

  • Code: myOrder.addPizza(myPizza);
  • Expected Output: PizzaOrder { Pizzas: {1: myPizza}, currentId: 1 }

Test: "It should add the price of the pizza to the total price of the order."

  • Code: myOrder.addPizza(myPizza);
  • Expected Output: PizzaOrder { Pizzas: {1: myPizza}, currentId: 1, totalPrice: 12.75 }

Describe: PizzaOrder.prototype.assignId()

Test: "It should increment the order's currentId by 1 then return the currentId."

  • Code: myOrder.assignId();
  • Expected Output: 2

Describe: PizzaOrder.prototype.findPizza(id)

Test: "It should take an ID number and return any pizza that matches that ID in the order."

  • Code: myOrder.findPizza(1);
  • Expected Output: Pizza { toppings: ["canadian bacon", "pineapple", "pepperoncini"], size: "medium", sauce: "garlic parmesan", crust: "stuffed", id: 1 }

Describe: PizzaOrder.prototype.removePizza(id)

Test: "It should take an ID number, remove any pizza matching that ID from the order, and return true if it does."

  • Code: myOrder.removePizza(1);
  • Expected Output: true

Test: "It should remove the price of the removed pizza from the total price of the order."

  • Code: myOrder.removePizza(1);
  • Expected Output: PizzaOrder { Pizzas: {}, currentId: 1, totalPrice: 0 }

About

Epicodus' fourth code review about Objects and Prototypes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors