-
-
Save dcomartin/d2f1075da00e11e1c22d2c3e7993c7c7 to your computer and use it in GitHub Desktop.
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
[Fact] | |
public void ThrowIfNull() | |
{ | |
Assert.Throws<ArgumentNullException>(() => new Username(null)); | |
} | |
[Fact] | |
public void ThrowIfEmpty() | |
{ | |
Assert.Throws<ArgumentNullException>(() => new Username(string.Empty)); | |
} | |
[Fact] | |
public void ReturnString() | |
{ | |
string username = Guid.NewGuid().ToString(); | |
Assert.Equal(username, new Username(username).ToString()); | |
} | |
[Fact] | |
public void ThrowOnDefault() | |
{ | |
Assert.Throws<InvalidCastException>(() => default(Username).ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment