Browse Source
Merge pull request #4797 from abpframework/maliming/Insert_Should_Set_Guid_Id
Move Insert_Should_Set_Guid_Id test method to repository test base class.
pull/4807/head
maliming
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
11 additions and
11 deletions
-
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs
-
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/Repository_Basic_Tests.cs
|
|
|
@ -64,15 +64,5 @@ namespace Volo.Abp.MongoDB.Repositories |
|
|
|
person.Phones.Count.ShouldBe(1); |
|
|
|
person.Phones.Any(p => p.PersonId == person.Id && p.Number == "1234567890").ShouldBeTrue(); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Insert_Should_Set_Guid_Id() |
|
|
|
{ |
|
|
|
var person = new Person(Guid.Empty, "New Person", 35); |
|
|
|
|
|
|
|
await PersonRepository.InsertAsync(person); |
|
|
|
|
|
|
|
person.Id.ShouldNotBe(Guid.Empty); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ using Xunit; |
|
|
|
|
|
|
|
namespace Volo.Abp.TestApp.Testing |
|
|
|
{ |
|
|
|
public abstract class Repository_Basic_Tests<TStartupModule> : TestAppTestBase<TStartupModule> |
|
|
|
public abstract class Repository_Basic_Tests<TStartupModule> : TestAppTestBase<TStartupModule> |
|
|
|
where TStartupModule : IAbpModule |
|
|
|
{ |
|
|
|
protected readonly IRepository<Person, Guid> PersonRepository; |
|
|
|
@ -105,5 +105,15 @@ namespace Volo.Abp.TestApp.Testing |
|
|
|
var person = await PersonRepository.FindAsync(personId); |
|
|
|
person.ShouldNotBeNull(); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Insert_Should_Set_Guid_Id() |
|
|
|
{ |
|
|
|
var person = new Person(Guid.Empty, "New Person", 35); |
|
|
|
|
|
|
|
await PersonRepository.InsertAsync(person); |
|
|
|
|
|
|
|
person.Id.ShouldNotBe(Guid.Empty); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|