• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ZipCodeCore/Maven.TDD-AnimalFactory

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ZipCodeCore/Maven.TDD-AnimalFactory

开源软件地址(OpenSource Url):

https://github.com/ZipCodeCore/Maven.TDD-AnimalFactory

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

TDD-AnimalFactory

  • Objective:
    • To create tests that ensure expected behavior of each class:
      • Cat
      • Dog
      • AnimalFactory
      • CatHouse
      • DogHouse
  • Purpose:
    • To establish familiarity with Test-Driven-Development (TDD) practices.
  • Getting context:
    • Click here to gain more familiarity with TDD-structured programming.

Getting Started

  • Begin by opening the project via its pom.xml with IntelliJ.
  • Continue by opening the test.java.rocks.zipcodewilmington package and completing each of the TODOs.

CatTest

  • Create tests for void setName(String name)
    • ensure that when .setName is invoked on an instance of Cat, the name field is being set to the respective value.
  • Create tests for setBirthDate(Date birthDate)
    • ensure that when .setBirthDate is invoked on an instance of Cat, the birthDate field is being set to the respective value.
  • Create tests for String speak()
    • ensure that when .speak is invoked on an instance of Cat, the value "meow!" is returned.
  • Create tests for void eat(Food food)
    • ensure that when .eat is invoked on an instance of Cat, the numberOfMealsEaten is increased by 1.
  • Create tests for Integer getId()
    • ensure that when .getId is invoked on an instance of Cat, the respective id value is returned.
  • Create test to check Animal inheritance; google search java instanceof keyword
    • ensure that a Cat is an instanceof an Animal
  • Create test to check Mammal inheritance; google search java instanceof keyword
    • ensure that a Cat is an instanceof a Mammal

DogTest

  • Create tests for void setName(String name)
    • ensure that when .setName is invoked on an instance of Dog, the name field is being set to the respective value.
  • Create tests for setBirthDate(Date birthDate)
    • ensure that when .setBirthDate is invoked on an instance of Dog, the birthDate field is being set to the respective value.
  • Create tests for String speak()
    • ensure that when .speak is invoked on an instance of Dog, the value "bark!" is returned.
  • Create tests for void eat(Food food)
    • ensure that when .eat is invoked on an instance of Dog, the numberOfMealsEaten is increased by 1.
  • Create tests for Integer getId()
    • ensure that when .getId is invoked on an instance of Dog, the respective id value is returned.
  • Create test to check Animal inheritance; google search java instanceof keyword
    • ensure that a Dog is an instanceof an Animal
  • Create test to check Mammal inheritance; google search java instanceof keyword
    • ensure that a Dog is an instanceof an Mammal

AnimalFactoryTest

  • Create Test for Animal createDog(String name, Date birthDate)
    • ensure that when .createDog is invoked on AnimalFactoryTest a Dog is created with the respective name and birthDate value.
  • Create Test for Animal createCat(String name, Date birthDate)
    • ensure that when .createCat is invoked on AnimalFactoryTest a Dog is created with the respective name and birthDate value.

CatHouseTest

  • Create tests for void add(Cat cat)
    • ensure that when .add is invoked on the CatHouse, a respective Cat object can be retrieved from the house.
  • Create tests for void remove(Cat cat)
    • ensure that when .remove is invoked on the CatHouse, a respective Cat object can no longer be retrieved from the house.
  • Create tests for void remove(Integer id)
    • ensure that when .remove is invoked on the CatHouse, a Cat object with the respective id can no longer be retrieved from the house.
  • Create tests for Cat getCatById(Integer id)
    • ensure that when .getCatById is invoked on the CatHouse, a Cat with the respective id is returned.
  • Create tests for Integer getNumberOfCats()
    • ensure that when .getNumberOfCats() is invoked on the CatHouse, the respective number of Cat objects is returned.

DogHouseTest

  • Create tests for void add(Dog dog)
    • ensure that when .add is invoked on the DogHouse, a respective Dog object can be retrieved from the house.
  • Create tests for void remove(Integer id)
    • ensure that when .remove is invoked on the DogHouse, a respective Dog object can no longer be retrieved from the house.
  • Create tests for void remove(Dog dog)
    • ensure that when .remove is invoked on the DogHouse, a Dog object with the respective id can no longer be retrieved from the house.
  • Create tests for Dog getDogById(Integer id)
    • ensure that when .getCatById is invoked on the DogHouse, a Dog with the respective id is returned.
  • Create tests for Integer getNumberOfDogs()
    • ensure that when .getNumberOfDogs() is invoked on the DogHouse, the respective number of Dog objects is returned.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap