From 21c218641ee7d480da864a8b428563e47c44fab3 Mon Sep 17 00:00:00 2001 From: htve Date: Fri, 27 Oct 2023 17:30:29 +0800 Subject: [PATCH] Fix error test caused by multiple attach --- .../Volo/Abp/Auditing/Auditing_Tests.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs index 3aa0da5a9b..4ac434d96c 100644 --- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs @@ -409,16 +409,13 @@ public class Auditing_Tests : AbpAuditingTestBase } #pragma warning disable 4014 - AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 2 && + AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 && x.EntityChanges[0].ChangeType == EntityChangeType.Updated && - x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithValueObject).FullName && - - x.EntityChanges[1].ChangeType == EntityChangeType.Updated && - x.EntityChanges[1].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName && - x.EntityChanges[1].PropertyChanges.Count == 1 && - x.EntityChanges[1].PropertyChanges[0].PropertyName == nameof(AppEntityWithValueObjectAddress.Country) && - x.EntityChanges[1].PropertyChanges[0].OriginalValue == "\"England\"" && - x.EntityChanges[1].PropertyChanges[0].NewValue == "\"Germany\"")); + x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName && + x.EntityChanges[0].PropertyChanges.Count == 1 && + x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithValueObjectAddress.Country) && + x.EntityChanges[0].PropertyChanges[0].OriginalValue == "\"England\"" && + x.EntityChanges[0].PropertyChanges[0].NewValue == "\"Germany\"")); #pragma warning restore 4014 }