From 69d7cf5d321f207ba6f5223120dc08861e2a8153 Mon Sep 17 00:00:00 2001 From: Dixin Date: Sat, 27 Jan 2024 02:20:14 -0800 Subject: [PATCH] Upgrade to C# 12. --- .../TestObjects/MockErrorDetectionStrategy.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Tests/TransientFaultHandling.Bvt.Tests/TestObjects/MockErrorDetectionStrategy.cs b/Tests/TransientFaultHandling.Bvt.Tests/TestObjects/MockErrorDetectionStrategy.cs index 1620f84..e0abb0b 100644 --- a/Tests/TransientFaultHandling.Bvt.Tests/TestObjects/MockErrorDetectionStrategy.cs +++ b/Tests/TransientFaultHandling.Bvt.Tests/TestObjects/MockErrorDetectionStrategy.cs @@ -2,12 +2,6 @@ public class MockErrorDetectionStrategy : ITransientErrorDetectionStrategy { - public MockErrorDetectionStrategy() - { - this.CallCount = 0; - this.ThreadIdList = new List(); - } - public bool IsTransient(Exception ex) { this.ThreadIdList.Add(Thread.CurrentThread.ManagedThreadId); @@ -25,7 +19,7 @@ ex switch _ => false }; - public int CallCount { get; set; } + public int CallCount { get; set; } = 0; - public List ThreadIdList { get; set; } + public List ThreadIdList { get; set; } = []; } \ No newline at end of file