-
Notifications
You must be signed in to change notification settings - Fork 0
/
Athlete.cs
57 lines (44 loc) · 1.41 KB
/
Athlete.cs
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
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace PrimitiveTypes
{
[TestClass]
public class Athlete
{
[TestMethod]
[TestCategory("06_Athlete")]
public void Compute_Exercises_For_Zero_Repetitions() {
int repetitions = 0;
int exercises = GetExercisesCount(repetitions);
Assert.AreEqual(0, exercises);
}
[TestMethod]
[TestCategory("06_Athlete")]
public void Compute_Exercises_For_One_Repetitions() {
int repetitions = 1;
int exercises = GetExercisesCount(repetitions);
Assert.AreEqual(1, exercises);
}
[TestMethod]
[TestCategory("06_Athlete")]
public void Compute_Exercises_For_3_Repetitions() {
int repetitions = 3 ;
int exercises = GetExercisesCount(repetitions);
Assert.AreEqual(9, exercises);
}
[TestMethod]
[TestCategory("06_Athlete")]
public void Compute_Exercises_For_10_Repetitions() {
int repetitions = 10;
int exercises = GetExercisesCount(repetitions);
Assert.AreEqual(100, exercises);
}
private int GetExercisesCount(int repetitions) {
if (repetitions > 0) {
return repetitions * repetitions;
} else {
return 0;
}
}
}
}