From fefb1378704291ae6e70ee8691640718333ac2f0 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Fri, 20 Jan 2023 07:45:39 +1100 Subject: [PATCH] fix test format --- Flow.Launcher.Test/Plugins/ExplorerTest.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Test/Plugins/ExplorerTest.cs b/Flow.Launcher.Test/Plugins/ExplorerTest.cs index 322441247..70c13f296 100644 --- a/Flow.Launcher.Test/Plugins/ExplorerTest.cs +++ b/Flow.Launcher.Test/Plugins/ExplorerTest.cs @@ -400,8 +400,9 @@ namespace Flow.Launcher.Test.Plugins [TestCase(@"c:\foo", @"c:\foo", true)] [TestCase(@"C:\Foo\", @"c:\foo\", true)] [TestCase(@"c:\foo", @"c:\foo\", false)] - public void PathEqualityComparatorEquality(string path1, string path2, bool expectedResult) + public void GivenTwoPaths_WhenCompared_ThenShouldBeExpectedSameOrDifferent(string path1, string path2, bool expectedResult) { + // Given var comparator = PathEqualityComparator.Instance; var result1 = new Result { @@ -413,13 +414,16 @@ namespace Flow.Launcher.Test.Plugins Title = Path.GetFileName(path2), SubTitle = path2 }; + + // When, Then Assert.AreEqual(expectedResult, comparator.Equals(result1, result2)); } [TestCase(@"c:\foo\", @"c:\foo\")] [TestCase(@"C:\Foo\", @"c:\foo\")] - public void PathEqualityComparatorHashCode(string path1, string path2) + public void GivenTwoPaths_WhenComparedHasCode_ThenShouldBeSame(string path1, string path2) { + // Given var comparator = PathEqualityComparator.Instance; var result1 = new Result { @@ -431,8 +435,11 @@ namespace Flow.Launcher.Test.Plugins Title = Path.GetFileName(path2), SubTitle = path2 }; + var hash1 = comparator.GetHashCode(result1); var hash2 = comparator.GetHashCode(result2); + + // When, Then Assert.IsTrue(hash1 == hash2); } }