diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-22 15:29:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-22 15:29:03 +0800 |
commit | 3716d2431de08194d3a107ef640febc47c3ee72a (patch) | |
tree | af83f8596b4fa78713733c0db6b4b6d1695d0ff0 /Timeline.Tests/DatabaseTest.cs | |
parent | a585c6e35829e9f2b4b0b8ce8c6b395e5ea84f2c (diff) | |
parent | 968f9688dd3ff7cae6f66af0e69bb03392311c88 (diff) | |
download | timeline-3716d2431de08194d3a107ef640febc47c3ee72a.tar.gz timeline-3716d2431de08194d3a107ef640febc47c3ee72a.tar.bz2 timeline-3716d2431de08194d3a107ef640febc47c3ee72a.zip |
Merge pull request #48 from crupest/user-details
Add user details.
Diffstat (limited to 'Timeline.Tests/DatabaseTest.cs')
-rw-r--r-- | Timeline.Tests/DatabaseTest.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Timeline.Tests/DatabaseTest.cs b/Timeline.Tests/DatabaseTest.cs index e280637c..f75ab71b 100644 --- a/Timeline.Tests/DatabaseTest.cs +++ b/Timeline.Tests/DatabaseTest.cs @@ -1,5 +1,4 @@ using FluentAssertions;
-using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using Timeline.Entities;
@@ -33,5 +32,21 @@ namespace Timeline.Tests _context.SaveChanges();
_context.UserAvatars.Count().Should().Be(1);
}
+
+ [Fact]
+ public void DeleteUserShouldAlsoDeleteDetail()
+ {
+ var user = _context.Users.First();
+ _context.UserDetails.Add(new UserDetailEntity
+ {
+ UserId = user.Id
+ });
+ _context.SaveChanges();
+ _context.UserDetails.Count().Should().Be(1);
+
+ _context.Users.Remove(user);
+ _context.SaveChanges();
+ _context.UserDetails.Count().Should().Be(0);
+ }
}
}
|