GithubHelp home page GithubHelp logo

eluckie / places-youve-been Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11 KB

Intermediate JavaScript (classwork) - practice creating objects in JavaScript using constructors & prototypes, and use TDD to build out business logic

HTML 34.99% JavaScript 64.09% CSS 0.92%
css html javascript

places-youve-been's Introduction

Places You've Been

By Aaron Demski, E Luckie, Vera Weikel

Places You've Been

Technologies Used

  • Javascript
  • CSS
  • HTML
  • TDD

Description

Create a website where you can keep track of all the places you've been. Each destination should be an object with multiple properties, like location, landmarks, time of year, notes, etc. Display those properties when a user clicks on a place's name. Complete the business logic for your place object. Use test-driven development to write your business logic, and include the tests in your README.md. After every passing test, make sure to commit your code.

Setup/Installation Requirements

  • Copy repo to your desktop.
  • Open index.html in your browser.

TDD Tests

Describe Place(placeName, countryName, seasonVisited, notes);

Test 1: "It should create an object for each place visited that includes the name of the place, country, the season visited, and any notes." Code: let testPlace = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); testPlace; Expected Output: Place { placeName: "Montana"; countryName: "US"; seasonVisited: "winter"; notes: "EXTREMELY cold, subzero temperatures" }

Describe Place.prototype.fullDescription()

Test 1: "To print the full description to the console." Code: let testPlace = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); testPlace.fullDescription(); Expected Output: "Montana, US"

Describe AllPlaces()

Test 1: "It should build an AllPlaces object housing ind'l Places." Code: let testPlace = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); let allPlaces = new AllPlaces(); allPlaces; Expected Output: allPlaces = "{}";

Describe AllPlaces.prototype.addPlace()

Test 1: "It should add specified place object to AllPlaces constructor object" Code: let testPlace = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); let testPlace2 = new Place("Vancouver", "CAN", "winter", "cold, cold temperatures"); let allPlaces = new AllPlaces(); allPlaces.addPlace(testPlace); allPlaces.addPlace(testPlace2); Expected Output: allPlaces.places {Montana: Place, Vancouver: Place}

Test 2: "It should add a unique ID to reference the object instance that assignId method is called on" Code: let testPlace = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); let allPlaces = new AllPlaces(); allPlaces.addPlace(testPlace); allPlaces; Expected Output: allPlaces.places {1: Place}

Describe AllPlaces.prototype.assignId()

Test 1: "It should assign a unique id to each place added to the AllPlaces object" Code: let testPlace1 = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); let allPlaces = new AllPlaces(); allPlaces.assignId(testPlace1); Expected Output: allPlaces.places {1}

Describe AllPlaces.prototype.deletePlaceById()

Test 1: "It should delete a place by a unique id previously added to the AllPlaces object" Code: let testPlace1 = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); let testPlace2 = new Place("Vancouver", "CAN", "winter", "cold, cold temperatures"); let allPlaces = new AllPlaces(); allPlaces.addPlace(testplace1); allPlaces.addPlace(testplace2); allPlaces.deletePlaceById(1); Expected Output: allPlaces.places {2: Place}

Describe AllPlaces.prototype.findPlaceById()

Test 1: "It should find a place by a unique id previously added to the AllPlaces object" Code: let testPlace1 = new Place("Montana", "US", "winter", "EXTREMELY cold, subzero temperatures"); let testPlace2 = new Place("Vancouver", "CAN", "winter", "cold, cold temperatures"); let allPlaces = new AllPlaces(); allPlaces.addPlace(testplace1); allPlaces.addPlace(testplace2); allPlaces.findPlaceById(1); Expected Output: allPlaces.places {1: Place}

Known Bugs

  • No known issues at this time

License

MIT

Copyright (c) 2023 Aaron Demski, E Luckie, Vera Weikel

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

places-youve-been's People

Contributors

eluckie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.