-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKidsWithCandiesTests.cs
More file actions
55 lines (44 loc) · 1.36 KB
/
KidsWithCandiesTests.cs
File metadata and controls
55 lines (44 loc) · 1.36 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
using Solutions.KidsWithTheGreatestNumberOfCandies;
namespace Solutions.Tests;
public class KidsWithTheGreatestNumberOfCandiesTests
{
[Fact]
public void KidsWithTheGreatestNumberOfCandies_Example1()
{
// Arrange
var solution = new Solution();
int[] candies = { 2, 3, 5, 1, 3 };
int extraCandies = 3;
bool[] expected = { true, true, true, false, true };
// Act
var result = solution.KidsWithCandies(candies, extraCandies);
// Assert
Assert.Equal(expected, result);
}
[Fact]
public void KidsWithTheGreatestNumberOfCandies_Example2()
{
// Arrange
var solution = new Solution();
int[] candies = { 4, 2, 1, 1, 2 };
int extraCandies = 1;
bool[] expected = { true, false, false, false, false };
// Act
var result = solution.KidsWithCandies(candies, extraCandies);
// Assert
Assert.Equal(expected, result);
}
[Fact]
public void KidsWithTheGreatestNumberOfCandies_Example3()
{
// Arrange
var solution = new Solution();
int[] candies = { 12, 1, 12 };
int extraCandies = 10;
bool[] expected = { true, false, true };
// Act
var result = solution.KidsWithCandies(candies, extraCandies);
// Assert
Assert.Equal(expected, result);
}
}