OSDN Git Service

コレクションの要素のアサーションをAssert.Contains/DoesNotContainで行う (xUnit2017)
authorKimura Youichi <kim.upsilon@bucyou.net>
Fri, 4 May 2018 20:03:05 +0000 (05:03 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 5 May 2018 01:53:55 +0000 (10:53 +0900)
OpenTween.Tests/IndexedSortedSetTest.cs
OpenTween.Tests/LRUCacheDictionaryTest.cs

index 68f048c..8a0ffbc 100644 (file)
@@ -183,8 +183,8 @@ namespace OpenTween
         {
             var set = new IndexedSortedSet<int> { 1, 2, 3 };
 
-            Assert.True(set.Contains(2));
-            Assert.False(set.Contains(999));
+            Assert.Contains(2, set);
+            Assert.DoesNotContain(999, set);
         }
 
         [Fact]
index 8908c3d..3c7f354 100644 (file)
@@ -226,10 +226,10 @@ namespace OpenTween
                 ["key3"] = "value3",
             };
 
-            Assert.True(dict.Contains(new KeyValuePair<string, string>("key1", "value1")));
-            Assert.False(dict.Contains(new KeyValuePair<string, string>("key3", "value2")));
-            Assert.False(dict.Contains(new KeyValuePair<string, string>("value3", "key3")));
-            Assert.False(dict.Contains(new KeyValuePair<string, string>("hogehoge", "hogehoge")));
+            Assert.Contains(new KeyValuePair<string, string>("key1", "value1"), dict);
+            Assert.DoesNotContain(new KeyValuePair<string, string>("key3", "value2"), dict);
+            Assert.DoesNotContain(new KeyValuePair<string, string>("value3", "key3"), dict);
+            Assert.DoesNotContain(new KeyValuePair<string, string>("hogehoge", "hogehoge"), dict);
         }
 
         [Fact]