-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommandResourceTest.cs
More file actions
43 lines (37 loc) · 1.23 KB
/
CommandResourceTest.cs
File metadata and controls
43 lines (37 loc) · 1.23 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
using AwesomeAssertions;
using Mbc.Pcs.Net.Command;
using System.Collections.Generic;
using Xunit;
namespace Mbc.Pcs.Net.Command.Test
{
public class CommandResourceTest
{
[Fact]
public void AddCustomResultCodeText()
{
// Arrange
var subject = new CommandResource(new Dictionary<ushort, string>()
{
[101] = "custom text 101",
[102] = "custom text 102",
});
// Act
subject.AddCustomResultCodeText(103, "custom text 103");
// Assert
subject.GetResultCodeString(101).Should().Be("custom text 101");
subject.GetResultCodeString(102).Should().Be("custom text 102");
subject.GetResultCodeString(103).Should().Be("custom text 103");
}
[Fact]
public void AddNoCustomResultCodeTextCheckFallbacks()
{
// Arrange
var subject = new CommandResource();
// Act
//
// Assert
subject.GetResultCodeString(101).Should().Be(string.Format(CommandResources.ERR_ResultCode, 101));
subject.GetResultCodeString(3).Should().Be(CommandResources.ERR_ResultCode_3);
}
}
}