Created
July 5, 2018 16:48
-
-
Save ifew/372ecee0dedd227d00e2b368820bda4f to your computer and use it in GitHub Desktop.
.Net Core 2 Fake
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
public void Display_Username_Shold_Be_iFew() | |
{ | |
var _options = new DbContextOptionsBuilder<MemberContext>().UseInMemoryDatabase("get_by_id_members").Options; | |
var _context = new MemberContext(_options); | |
_context.Members.Add( | |
new MemberModel | |
{ | |
Id = 1, | |
Fullname = "iFew", | |
Card_no = "6425880473", | |
Birthday = new DateTime(1987, 01, 01), | |
Mobilephone = "0912345678" | |
}); | |
_context.SaveChanges(); | |
MemberService _memberService = new MemberService(_context); | |
MemberModel actual = _memberService.Get_Member_Information_By_ID("1"); | |
Assert.Equal(1, actual.Id); | |
Assert.Equal("iFew", actual.Fullname); | |
Assert.Equal("6425880473", actual.Card_no); | |
Assert.Equal(new DateTime(1987, 01, 01), actual.Birthday); | |
Assert.Equal("0912345678", actual.Mobilephone); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment