-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using HeboTech.ATLib.Dtos; | ||
using System; | ||
using Xunit; | ||
|
||
namespace HeboTech.ATLib.Tests.DTOs | ||
{ | ||
public class MessageStorageTests | ||
{ | ||
[Theory] | ||
[InlineData("SM")] | ||
[InlineData("ME")] | ||
[InlineData("MT")] | ||
[InlineData("BM")] | ||
[InlineData("SR")] | ||
[InlineData("TA")] | ||
public void TProperties_are_set(string storageName) | ||
{ | ||
MessageStorage storage = MessageStorage.Parse(storageName); | ||
|
||
Assert.Equal(storageName, storage.Value); | ||
Assert.Equal(storageName, storage); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null)] | ||
[InlineData("")] | ||
[InlineData("A")] | ||
[InlineData("AB")] | ||
public void Throws_on_invalid_name(string storageName) | ||
{ | ||
Assert.Throws<ArgumentException>(() => MessageStorage.Parse(storageName)); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/HeboTech.ATLib.Tests/DTOs/PreferredMessageStorageTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using HeboTech.ATLib.Dtos; | ||
using HeboTech.ATLib.DTOs; | ||
using Xunit; | ||
|
||
namespace HeboTech.ATLib.Tests.DTOs | ||
{ | ||
public class PreferredMessageStorageTests | ||
{ | ||
[Theory] | ||
[InlineData("SM", 5, 10)] | ||
[InlineData("ME", 5, 10)] | ||
[InlineData("MT", 5, 10)] | ||
[InlineData("BM", 5, 10)] | ||
[InlineData("SR", 5, 10)] | ||
[InlineData("TA", 5, 10)] | ||
public void Test(string expectedStorageName, int expectedStorageMessages, int expectedStorageMessageLocations) | ||
{ | ||
PreferredMessageStorage sut = new(MessageStorage.Parse(expectedStorageName), expectedStorageMessages, expectedStorageMessageLocations); | ||
|
||
Assert.Equal(expectedStorageName, sut.StorageName); | ||
Assert.Equal(expectedStorageMessages, sut.StorageMessages); | ||
Assert.Equal(expectedStorageMessageLocations, sut.StorageMessageLocations); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters