From add102ed27c91e672f9aba11ef2d1084fbb0d002 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Mon, 19 Dec 2022 14:19:07 +1100 Subject: [PATCH] remove some obsoletes (#749) --- src/Verify/Counter_Object.cs | 26 --------------------- src/Verify/DerivePaths/Obsolete.cs | 11 --------- src/Verify/SettingsTask.cs | 19 ---------------- src/Verify/VerifySettings.cs | 36 ------------------------------ 4 files changed, 92 deletions(-) delete mode 100644 src/Verify/Counter_Object.cs delete mode 100644 src/Verify/DerivePaths/Obsolete.cs diff --git a/src/Verify/Counter_Object.cs b/src/Verify/Counter_Object.cs deleted file mode 100644 index 1421bcd79d..0000000000 --- a/src/Verify/Counter_Object.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace VerifyTests; - -public partial class Counter -{ - [Obsolete("Id replacement no longer used")] - ConcurrentDictionary idCache = new(); - - [Obsolete("Id replacement no longer used")] - int currentId; - - [Obsolete("Id replacement no longer used")] - public int NextId(object input) => - NextValue(input).intValue; - - [Obsolete("Id replacement no longer used")] - public string NextIdString(object input) => - NextValue(input).stringValue; - - [Obsolete("Id replacement no longer used")] - (int intValue, string stringValue) NextValue(object input) => - idCache.GetOrAdd(input, _ => - { - var value = Interlocked.Increment(ref currentId); - return (value, $"Id_{value}"); - }); -} \ No newline at end of file diff --git a/src/Verify/DerivePaths/Obsolete.cs b/src/Verify/DerivePaths/Obsolete.cs deleted file mode 100644 index e9f7273d91..0000000000 --- a/src/Verify/DerivePaths/Obsolete.cs +++ /dev/null @@ -1,11 +0,0 @@ -// ReSharper disable UnusedParameter.Local - -namespace VerifyTests; - -public static partial class VerifierSettings -{ - [Obsolete("Use Verifier.DerivePathInfo for xunit, expecto and nunit. Use VerifierBase.DerivePathInfo for mstest.")] - public static void DerivePathInfo(string sourceFile, string projectDirectory, Type type, MethodInfo method) - { - } -} \ No newline at end of file diff --git a/src/Verify/SettingsTask.cs b/src/Verify/SettingsTask.cs index afa5da5c23..8b8b226469 100644 --- a/src/Verify/SettingsTask.cs +++ b/src/Verify/SettingsTask.cs @@ -22,15 +22,6 @@ public SettingsTask AddExtraSettings(Action action) return this; } - [Obsolete(@"An explicit `extension` parameter has been added to all - overloads that require it: - * Verify(Stream stream, string extension) - * Verify(byte[] bytes, string extension) - * Verify(string target, string extension) -", true)] - public bool TryGetExtension([NotNullWhen(true)] out string? extension) => - throw new(); - /// /// Append a key-value pair to the serialized target. /// @@ -301,16 +292,6 @@ public SettingsTask UseTextForParameters(string parametersText) return this; } - - [Obsolete(@"An explicit `extension` parameter has been added to all - overloads that require it: - * Verify(Stream stream, string extension) - * Verify(byte[] bytes, string extension) - * Verify(string target, string extension) -", true)] - public SettingsTask UseExtension(string extension) => - throw new(); - public VerifySettings CurrentSettings => settings ??= new(); public Task ToTask() => diff --git a/src/Verify/VerifySettings.cs b/src/Verify/VerifySettings.cs index a5fbdb2849..356c47a180 100644 --- a/src/Verify/VerifySettings.cs +++ b/src/Verify/VerifySettings.cs @@ -81,42 +81,6 @@ public void UseTextForParameters(string parametersText) this.parametersText = parametersText; } - [Obsolete(@"An explicit `extension` parameter has been added to all - overloads that require it: - * Verify(Stream stream, string extension) - * Verify(byte[] bytes, string extension) - * Verify(string target, string extension) -", true)] - public void UseExtension(string extension) => - throw new(); - - [Obsolete(@"An explicit `extension` parameter has been added to all - overloads that require it: - * Verify(Stream stream, string extension) - * Verify(byte[] bytes, string extension) - * Verify(string target, string extension) -", true)] - public bool TryGetExtension([NotNullWhen(true)] out string? extension) => - throw new(); - - [Obsolete(@"An explicit `extension` parameter has been added to all - overloads that require it: - * Verify(Stream stream, string extension) - * Verify(byte[] bytes, string extension) - * Verify(string target, string extension) -", true)] - internal string ExtensionOrTxt(string defaultValue = "txt") => - throw new(); - - [Obsolete(@"An explicit `extension` parameter has been added to all - overloads that require it: - * Verify(Stream stream, string extension) - * Verify(byte[] bytes, string extension) - * Verify(string target, string extension) -", true)] - internal string ExtensionOrBin() => - throw new(); - internal bool IsAutoVerify => VerifierSettings.autoVerify || autoVerify;