Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing of partial properties #7262

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty1Tests.cs
Original file line number Diff line number Diff line change
@@ -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; }

}


19 changes: 19 additions & 0 deletions src/NServiceBus.Core.Tests/Sagas/SagaModelPartialProperty2Tests.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}


18 changes: 0 additions & 18 deletions src/NServiceBus.Core.Tests/Sagas/SagaModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<Pending>")]
int _uniqueProperty;

public partial int UniqueProperty { get; set; }

public partial int UniqueProperty
{
get
{
return _uniqueProperty;
}
set
{
_uniqueProperty = value;
}
}
}

public class MyEntity2 : MyEntity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading