Skip to content
This repository was archived by the owner on May 20, 2020. It is now read-only.

Commit 93e3407

Browse files
authored
Merge pull request #65 from webpapaya/patch-2
Add employee report kata.
2 parents 4ef3fcf + 4a2403f commit 93e3407

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

content/kata/Employee-Report.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: "Employee Report"
3+
draft: false
4+
date: "2019-06-15T00:00:00"
5+
aliases:
6+
- "/Employee-Report"
7+
8+
---
9+
**About this Kata**
10+
11+
This Kata was developed to show how overspecification of assertions harms maintainability of tests.
12+
A blog post with a possible solution can be found here: https://dev.to/webpapaya/writing-better-test-assertions-lml
13+
14+
**Problem Description**
15+
You're building an employee management system of a local grocery store. The shop-owner wants to open the shop on Sunday and due to legal restrictions employees younger than 18 years are not allowed to work Sundays. The employee asks for a reporting feature so she can schedule work shifts. All employees are already stored somewhere and have the following properties:
16+
17+
- name: string (the name of the employee)
18+
- age: number (the age in years of the employee)
19+
20+
```js
21+
const employees = [
22+
{ name: 'Max', age: 17 },
23+
{ name: 'Sepp', age: 18 },
24+
{ name: 'Nina', age: 15 },
25+
{ name: 'Mike', age: 51 },
26+
];
27+
```
28+
29+
**Rules**
30+
Start with the first user-story and write at least one test for every requirement. Try not to look on future requirements upfront and follow the TDD-Cycle strictly.
31+
32+
- As shop owner I want to view a list of all employees, which are older than 18 years, so that I know who is allowed to work on Sundays.
33+
- As shop owner I want the list of employees to be sorted by their name, so I can find employees easier.
34+
- As shop owner I want the list of employees to be capitalized, so I can read it better.
35+
- As shop owner I want the employees to be sorted by their names descending instead of ascending.

0 commit comments

Comments
 (0)