-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWatermelon.cs
48 lines (37 loc) · 1.14 KB
/
Watermelon.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
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace PrimitiveTypes
{
[TestClass]
public class Watermelon
{
[TestMethod]
[TestCategory("05_Watermelon")]
public void Cant_Be_Splited_If_Weight_Is_Less_Than_Four() {
int weight = 2;
bool canBeSplited = CanBeSplited(weight);
Assert.IsFalse(canBeSplited);
}
[TestMethod]
[TestCategory("05_Watermelon")]
public void Cant_Be_Splited_If_Weight_Is_Not_Divisible_By_Two() {
int weight = 13;
bool canBeSplited = CanBeSplited(weight);
Assert.IsFalse(canBeSplited);
}
[TestMethod]
[TestCategory("05_Watermelon")]
public void Can_Be_Splited_If_Weight_Is_Divisible_By_Two() {
int weight = 14;
bool canBeSplited = CanBeSplited(weight);
Assert.IsTrue(canBeSplited);
}
private bool CanBeSplited(int weight) {
if (weight >= 4) {
return weight % 2 == 0;
} else {
return false;
}
}
}
}