Browse Source
Refactor InsertAsync test to include nullable GUID property validation
pull/22641/head
maliming
10 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
3 additions and
1 deletions
-
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Repositories/Repository_Basic_Tests.cs
|
|
|
@ -53,11 +53,12 @@ public class Repository_Basic_Tests : Repository_Basic_Tests<AbpMongoDbTestModul |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public override async Task InsertAsync() |
|
|
|
public async override Task InsertAsync() |
|
|
|
{ |
|
|
|
var person = new Person(Guid.NewGuid(), "New Person", 35); |
|
|
|
person.Phones.Add(new Phone(person.Id, "1234567890")); |
|
|
|
person.SetProperty("test-guid-property", person.Id); |
|
|
|
person.SetProperty("test-nullable-guid-property", (Guid?)person.Id); |
|
|
|
|
|
|
|
await PersonRepository.InsertAsync(person); |
|
|
|
|
|
|
|
@ -67,6 +68,7 @@ public class Repository_Basic_Tests : Repository_Basic_Tests<AbpMongoDbTestModul |
|
|
|
person.Phones.Count.ShouldBe(1); |
|
|
|
person.Phones.Any(p => p.PersonId == person.Id && p.Number == "1234567890").ShouldBeTrue(); |
|
|
|
person.GetProperty<Guid>("test-guid-property").ShouldBe(person.Id); |
|
|
|
person.GetProperty<Guid?>("test-nullable-guid-property").ShouldBe(person.Id); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
|