# day-three-homework **Repository Path**: userlyx/day-three-homework ## Basic Information - **Project Name**: day-three-homework - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-15 - **Last Updated**: 2022-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TDD ## 开发环境 - JDK11+ ## 业务目标 ## Tasking ## 编码路线 ## 参考资料 - [JUnit 5用户指南](https://gitee.com/liushide/junit5_cn_doc/blob/master/junit5UserGuide_zh_cn.md#https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Fjunit-team%2Fjunit5-samples%2Ftree%2Fr5.0.2%2Fjunit5-gradle-consumer) - [Gradle 用户指南](https://docs.gradle.org/current/# TDD @FizzBuzz ## 开发环境 - JDK11+ ## 业务目标 ### 商品价格计算 "镶金玫瑰"!这是一家魔兽世界里的小商店。出售的商品也都是高价值的。但不妙的是,随着商品 逐渐接近保质期,它们的价值也不断下滑。你需要开发一个IT系统来更新库存信息。 1. 常规商品saleIn减一天,并且在保质期内,价格减1 - Given 保质期内常规商品 - When 生产日期 +1 天 - then 商品价格减1 2. 常规商品过期一天,价格减2 - Given 过期的常规商品 - When 过期一天 - then 商品价格减2 3. 常规商品过期100+天,商品价格为0 - Given 过期的常规商品 - When 过期100天 - then 商品价格为0 4. 陈年干酪saleIn减一天并且在保质期内,价格加1 - Given 保质期内陈年干酪 - When 生产日期+1 天 - then 商品价格加1 5. 陈年干酪过期一天,价格加2 - Given 过期的陈年干酪 - When 过期一天 - then 商品价格加2 6. 陈年干酪过期100+天,商品价格为50 - Given 过期的常规商品 - When 过期100天 - then 商品价格为50 7. 萨弗拉斯saleIn减一天并且在保质期内,价格不变 - Given 保质期内萨弗拉斯 - When 生产日期+1 天 - then 商品价格不变 8. 萨弗拉斯过期一天,价格不变 - Given 过期的萨弗拉斯 - When 过期一天 - then 商品价格加不变 9. 后台门票saleIn减一天,并且在保质期内前10天,价格减加2 - Given 保质期内后台门票 - When 生产日期 +1 天 - then 商品价格加2】 10. 后台门票saleIn减一天,并且在保质期内前5天,价格减加3 - Given 未过期后台门票在保质期内前 - When 生产日期+1天 - then 商品价格+3 11. 后台门票过期一天,价格为0 - Given 过期的后台门票 - When 过期一天 - then 商品价格为0 ## Tasking | Task | Input(name, saleIn, quality, updatedSellIn) | Output | |:---|:---|:---| | 1 | NORMAL, 2, 20, 1 | 19 | | 2 | NORMAL, -1,20, -2 | 18 | | 3 | NORMAL, 5, 20, -100 | 0 | | 4 | AGED_BRIE, 2, 49, 1 | 50 | | 5 | AGED_BRIE, 0, 20, -1 | 22 | | 6 | AGED_BRIE, 0, 20, -1000 | 50 | | 7 | SULFURAS, 3, 45, 2 | 45 | | 8 | SULFURAS, -1, 45, -2 | 45 | | 9 | BACKSTAGE_BRIE, 10, 20, 9 | 22 | | 10 | BACKSTAGE_BRIE, 5, 20, 4 | 23 | | 11 | BACKSTAGE_BRIE, 5, 20, 0 | 0 | ## 编码路线 ## 参考资料 - [JUnit 5用户指南](https://gitee.com/liushide/junit5_cn_doc/blob/master/junit5UserGuide_zh_cn.md#https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Fjunit-team%2Fjunit5-samples%2Ftree%2Fr5.0.2%2Fjunit5-gradle-consumer) - [Gradle 用户指南](https://docs.gradle.org/current/userguide/userguide.html)/userguide.html)