|
|
|
@ -60,5 +60,27 @@ namespace Volo.Abp.TestApp.Testing |
|
|
|
douglas.Age.ShouldBe(42); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Cascading_Entities_Should_Not_Be_Deleted_When_Soft_Deleting_Entities() |
|
|
|
{ |
|
|
|
var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); |
|
|
|
douglas.Phones.ShouldNotBeEmpty(); |
|
|
|
|
|
|
|
await PersonRepository.DeleteAsync(douglas); |
|
|
|
|
|
|
|
douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); |
|
|
|
douglas.ShouldBeNull(); |
|
|
|
|
|
|
|
using (DataFilter.Disable<ISoftDelete>()) |
|
|
|
{ |
|
|
|
douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); |
|
|
|
douglas.ShouldNotBeNull(); |
|
|
|
douglas.IsDeleted.ShouldBeTrue(); |
|
|
|
douglas.DeletionTime.ShouldNotBeNull(); |
|
|
|
|
|
|
|
douglas.Phones.ShouldNotBeEmpty(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|