-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrumMapTest.cs
More file actions
59 lines (49 loc) Β· 1.34 KB
/
Copy pathDrumMapTest.cs
File metadata and controls
59 lines (49 loc) Β· 1.34 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
namespace Models.Tests;
public class DrumMapTest
{
[Fact]
public void DrumMap_DefaultConstructor_InitializesProperties()
{
var drumMap = new DrumMap();
Assert.NotNull(drumMap.Name);
Assert.Equal(string.Empty, drumMap.Name);
Assert.NotNull(drumMap.Mapping);
Assert.Empty(drumMap.Mapping);
}
[Fact]
public void DrumMap_CanSetName()
{
var drumMap = new DrumMap
{
Name = "My Drum Map"
};
Assert.Equal("My Drum Map", drumMap.Name);
}
[Fact]
public void DrumMap_CanAddMapping()
{
var drumMap = new DrumMap();
drumMap.Mapping["Kick"] = 36;
drumMap.Mapping["Snare"] = 38;
Assert.Equal(2, drumMap.Mapping.Count);
Assert.Equal(36, drumMap.Mapping["Kick"]);
Assert.Equal(38, drumMap.Mapping["Snare"]);
}
[Fact]
public void DrumMap_CanUpdateMapping()
{
var drumMap = new DrumMap();
drumMap.Mapping["Kick"] = 36;
drumMap.Mapping["Kick"] = 35;
Assert.Single(drumMap.Mapping);
Assert.Equal(35, drumMap.Mapping["Kick"]);
}
[Fact]
public void DrumMap_CanRemoveMapping()
{
var drumMap = new DrumMap();
drumMap.Mapping["Kick"] = 36;
drumMap.Mapping.Remove("Kick");
Assert.Empty(drumMap.Mapping);
}
}