diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-25 23:03:36 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-25 23:03:36 +0800 |
commit | 181b53e270ff7c0558edec75b8b255d487e796c3 (patch) | |
tree | 5315d3339e3fcb43c22b0e39c761ab46d45f9b9c /Timeline.Tests/DatabaseTest.cs | |
parent | a175f8328d7a6c36464676d54fc50d03e64be0af (diff) | |
download | timeline-181b53e270ff7c0558edec75b8b255d487e796c3.tar.gz timeline-181b53e270ff7c0558edec75b8b255d487e796c3.tar.bz2 timeline-181b53e270ff7c0558edec75b8b255d487e796c3.zip |
Add user detail service.
Diffstat (limited to 'Timeline.Tests/DatabaseTest.cs')
-rw-r--r-- | Timeline.Tests/DatabaseTest.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Timeline.Tests/DatabaseTest.cs b/Timeline.Tests/DatabaseTest.cs index b5681491..fc153c24 100644 --- a/Timeline.Tests/DatabaseTest.cs +++ b/Timeline.Tests/DatabaseTest.cs @@ -42,5 +42,22 @@ namespace Timeline.Tests _context.SaveChanges();
_context.UserAvatars.Count().Should().Be(0);
}
+
+ [Fact]
+ public void DeleteUserShouldAlsoDeleteDetail()
+ {
+ var user = _context.Users.First();
+ _context.UserDetails.Count().Should().Be(0);
+ _context.UserDetails.Add(new UserDetail
+ {
+ Nickname = null,
+ UserId = user.Id
+ });
+ _context.SaveChanges();
+ _context.UserDetails.Count().Should().Be(1);
+ _context.Users.Remove(user);
+ _context.SaveChanges();
+ _context.UserDetails.Count().Should().Be(0);
+ }
}
}
|