From 7776138909581c5e93cd6f89846bf608d7ae6dd7 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 29 Nov 2022 17:27:33 +0000 Subject: [PATCH] Remove calls to no-longer-existing Clear(bool) --- X10D.Tests/src/IO/DirectoryInfoTests.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/X10D.Tests/src/IO/DirectoryInfoTests.cs b/X10D.Tests/src/IO/DirectoryInfoTests.cs index 375289d..be980ee 100644 --- a/X10D.Tests/src/IO/DirectoryInfoTests.cs +++ b/X10D.Tests/src/IO/DirectoryInfoTests.cs @@ -31,7 +31,7 @@ public class DirectoryInfoTests Assert.AreEqual(1, directory.GetFiles().Length); Assert.AreEqual(1, directory.GetDirectories().Length); - directory.Clear(false); + directory.Clear(); Assert.AreEqual(0, directory.GetFiles().Length); Assert.AreEqual(0, directory.GetDirectories().Length); Assert.IsTrue(directory.Exists); @@ -47,30 +47,17 @@ public class DirectoryInfoTests directory.Clear(); } - [TestMethod] - public void Clear_ShouldNotThrow_WhenThrowOnErrorIsFalse() - { - var directory = new DirectoryInfo(@"/@12#3"); - Assert.IsFalse(directory.Exists); - - directory.Clear(); - directory.Clear(false); - - Assert.IsTrue(true); // if this assertion passes, then the test passed - } - [TestMethod] public void Clear_ShouldThrowArgumentNullException_GivenNull() { Assert.ThrowsException(() => ((DirectoryInfo?)null)!.Clear()); - Assert.ThrowsException(() => ((DirectoryInfo?)null)!.Clear(true)); } [TestMethod] public void Clear_ShouldThrowDirectoryNotFoundException_GivenInvalidDirectory() { var directory = new DirectoryInfo(@"123:/@12#3"); - Assert.ThrowsException(() => directory.Clear(true)); + Assert.ThrowsException(() => directory.Clear()); } [TestMethod] @@ -78,6 +65,6 @@ public class DirectoryInfoTests { var directory = new DirectoryInfo(@"/@12#3"); Assert.IsFalse(directory.Exists); - Assert.ThrowsException(() => directory.Clear(true)); + Assert.ThrowsException(() => directory.Clear()); } }