-
-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy pathlasagna_test.cpp
More file actions
75 lines (58 loc) · 1.77 KB
/
lasagna_test.cpp
File metadata and controls
75 lines (58 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "lasagna.cpp"
#ifdef EXERCISM_TEST_SUITE
#include <catch2/catch.hpp>
#else
#include "test/catch.hpp"
#endif
using namespace std;
TEST_CASE("Preparation time correct", "[task_1]") {
int actual = 40;
int expected = ovenTime();
REQUIRE(expected == actual);
}
#if defined(EXERCISM_RUN_ALL_TESTS)
TEST_CASE("Fresh in the oven", "[task_2]") {
int timeSpendInOven = 0;
int neededBakeTime = 40;
int actual = remainingOvenTime(timeSpendInOven);
int expected{neededBakeTime - timeSpendInOven};
REQUIRE(expected == actual);
}
TEST_CASE("Halfway done", "[task_2]") {
int timeSpendInOven = 20;
int neededBakeTime = 40;
int actual = remainingOvenTime(timeSpendInOven);
int expected{neededBakeTime - timeSpendInOven};
REQUIRE(expected == actual);
}
TEST_CASE("Correct for six layers", "[task_3]") {
int timePerLayer = 2;
int layers = 6;
int actual = preparationTime(layers);
int expected{timePerLayer * layers};
REQUIRE(expected == actual);
}
TEST_CASE("Correct for 11 layers", "[task_3]") {
int timePerLayer = 2;
int layers = 11;
int actual = preparationTime(layers);
int expected{timePerLayer * layers};
REQUIRE(expected == actual);
}
TEST_CASE("Fresh in the oven, 12 layers!", "[task_4]") {
int timeSpendInOven = 0;
int timePerLayer = 2;
int layers = 12;
int actual = elapsedTime(layers, timeSpendInOven);
int expected{timePerLayer * layers + timeSpendInOven};
REQUIRE(expected == actual);
}
TEST_CASE("One minute left, 5 layers!", "[task_4]") {
int timeSpendInOven = 39;
int timePerLayer = 2;
int layers = 5;
int actual = elapsedTime(layers, timeSpendInOven);
int expected{timePerLayer * layers + timeSpendInOven};
REQUIRE(expected == actual);
}
#endif