-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathAccountInputTest.cs
More file actions
45 lines (40 loc) · 1.23 KB
/
AccountInputTest.cs
File metadata and controls
45 lines (40 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
44
45
using MainCore.UI.Models.Input;
namespace MainCore.Test.UI.Models.Input
{
public class AccountInputTest
{
[Fact]
public void ToDto_UsernameHasNonAlphanumeric()
{
// Arrange
var accountInput = new AccountInput();
accountInput.Username = "test user @.int";
// Act
var dto = accountInput.ToDto();
// Assert
dto.Username.ShouldBe("test_user_int");
}
[Fact]
public void ToDto_ServerUrlHasTrail()
{
// Arrange
var accountInput = new AccountInput();
accountInput.Server = "https://ts1.x1.international.travian.com/dorf1.php";
// Act
var dto = accountInput.ToDto();
// Assert
dto.Server.ShouldBe("https://ts1.x1.international.travian.com");
}
[Fact]
public void ToDto_ServerUrlDontValid_ReturnEmpty()
{
// Arrange
var accountInput = new AccountInput();
accountInput.Server = "ts1.x1.international.travian.com/dorf1.php";
// Act
var dto = accountInput.ToDto();
// Assert
dto.Server.ShouldBe("");
}
}
}