diff options
author | crupest <crupest@outlook.com> | 2019-11-20 00:28:53 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-11-20 00:28:53 +0800 |
commit | a72960e54a89bd31dcb8be8f52e097007dfd23e5 (patch) | |
tree | 55eaf43bda897148b0fa8a65406e7289aed3832e /Timeline.Tests/Helpers/MockUser.cs | |
parent | f3c7912caec2e9eee8a685d8751894f357528a71 (diff) | |
download | timeline-a72960e54a89bd31dcb8be8f52e097007dfd23e5.tar.gz timeline-a72960e54a89bd31dcb8be8f52e097007dfd23e5.tar.bz2 timeline-a72960e54a89bd31dcb8be8f52e097007dfd23e5.zip |
Clean and refactor tests.
Diffstat (limited to 'Timeline.Tests/Helpers/MockUser.cs')
-rw-r--r-- | Timeline.Tests/Helpers/MockUser.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/MockUser.cs b/Timeline.Tests/Helpers/MockUser.cs new file mode 100644 index 00000000..8d738525 --- /dev/null +++ b/Timeline.Tests/Helpers/MockUser.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using Timeline.Models; + +namespace Timeline.Tests.Helpers +{ + public class MockUser + { + public MockUser(string username, string password, bool administrator) + { + Info = new UserInfo(username, administrator); + Password = password; + } + + public UserInfo Info { get; set; } + public string Username => Info.Username; + public string Password { get; set; } + public bool Administrator => Info.Administrator; + + public static MockUser User { get; } = new MockUser("user", "userpassword", false); + public static MockUser Admin { get; } = new MockUser("admin", "adminpassword", true); + + public static IReadOnlyList<UserInfo> UserInfoList { get; } = new List<UserInfo> { User.Info, Admin.Info }; + } +} |