diff --git a/src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty1Tests.cs b/src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty1Tests.cs new file mode 100644 index 0000000000..fdf527cbc8 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty1Tests.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Core.Tests.Sagas.TypeBasedSagas; + +public partial class MyPartialEntity : ContainSagaData +{ + [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0032:Use auto property", Justification = "Manual getter/setter provides control over property behavior.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0051:Remove unused private members", Justification = "Field is part of a partial property implementation.")] + + int _uniqueProperty; + + public partial int UniqueProperty { get; set; } + +} + + diff --git a/src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty2Tests.cs b/src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty2Tests.cs new file mode 100644 index 0000000000..fb44b2ecb5 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty2Tests.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Core.Tests.Sagas.TypeBasedSagas; + +public partial class MyPartialEntity : ContainSagaData +{ + + public partial int UniqueProperty + { + get + { + return _uniqueProperty; + } + set + { + _uniqueProperty = value; + } + } +} + + diff --git a/src/NServiceBus.Core.Tests/Sagas/SagaModelTests.cs b/src/NServiceBus.Core.Tests/Sagas/SagaModelTests.cs index 232df02f4f..5754e40b34 100644 --- a/src/NServiceBus.Core.Tests/Sagas/SagaModelTests.cs +++ b/src/NServiceBus.Core.Tests/Sagas/SagaModelTests.cs @@ -161,25 +161,7 @@ public class MyEntity : ContainSagaData public int UniqueProperty { get; set; } } - public partial class MyPartialEntity : ContainSagaData - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0032:Use auto property", Justification = "")] - int _uniqueProperty; - - public partial int UniqueProperty { get; set; } - public partial int UniqueProperty - { - get - { - return _uniqueProperty; - } - set - { - _uniqueProperty = value; - } - } - } public class MyEntity2 : MyEntity { diff --git a/src/NServiceBus.Core.Tests/Sagas/When_saga_is_correlated_on_a_unsupported_datetime_property_type.cs b/src/NServiceBus.Core.Tests/Sagas/When_saga_is_correlated_on_a_unsupported_datetime_property_type.cs index 72fa1a9277..032cce7f9c 100644 --- a/src/NServiceBus.Core.Tests/Sagas/When_saga_is_correlated_on_a_unsupported_datetime_property_type.cs +++ b/src/NServiceBus.Core.Tests/Sagas/When_saga_is_correlated_on_a_unsupported_datetime_property_type.cs @@ -1,7 +1,6 @@ namespace NServiceBus.Core.Tests.Sagas.TypeBasedSagas; using System; -using System.Collections.Generic; using System.Threading.Tasks; using NServiceBus.Sagas; using NUnit.Framework;