Browse Source

Fix test case to use block bodies instead of expression-bodied members

Co-authored-by: christophwille <344208+christophwille@users.noreply.github.com>
copilot/add-field-keyword-auto-properties
copilot-swe-agent[bot] 1 month ago
parent
commit
98d27e8e25
  1. 16
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/SemiAutoProperties.cs

16
ICSharpCode.Decompiler.Tests/TestCases/Pretty/SemiAutoProperties.cs

@ -22,9 +22,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{ {
internal class SemiAutoProperties internal class SemiAutoProperties
{ {
// Semi-auto property with validation in setter
public int ValidatedProperty { public int ValidatedProperty {
get => field; get {
return field;
}
set { set {
if (value < 0) if (value < 0)
{ {
@ -34,7 +35,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
} }
} }
// Semi-auto property with lazy initialization
public string LazyProperty { public string LazyProperty {
get { get {
if (field == null) if (field == null)
@ -43,12 +43,15 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
} }
return field; return field;
} }
set => field = value; set {
field = value;
}
} }
// Semi-auto property with notification
public int NotifyProperty { public int NotifyProperty {
get => field; get {
return field;
}
set { set {
if (field != value) if (field != value)
{ {
@ -58,7 +61,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
} }
} }
// Getter-only semi-auto property with initialization
public int ReadOnlyWithInit { public int ReadOnlyWithInit {
get { get {
if (field == 0) if (field == 0)

Loading…
Cancel
Save