diff options
Diffstat (limited to '')
-rw-r--r-- | src/internal/WixInternal.MSTestSupport/WixAssert.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/internal/WixInternal.MSTestSupport/WixAssert.cs b/src/internal/WixInternal.MSTestSupport/WixAssert.cs index 927ebee6..b4c59fa5 100644 --- a/src/internal/WixInternal.MSTestSupport/WixAssert.cs +++ b/src/internal/WixInternal.MSTestSupport/WixAssert.cs | |||
@@ -77,15 +77,19 @@ namespace WixInternal.MSTestSupport | |||
77 | Assert.AreNotEqual(expected, actual, comparer); | 77 | Assert.AreNotEqual(expected, actual, comparer); |
78 | } | 78 | } |
79 | 79 | ||
80 | public static void Single<T>(IEnumerable<T> collection) | 80 | public static T Single<T>(IEnumerable<T> collection) |
81 | { | 81 | { |
82 | Assert.AreEqual(1, collection.Count()); | 82 | return collection.Single(); |
83 | } | 83 | } |
84 | 84 | ||
85 | public static void Single<T>(IEnumerable<T> collection, Func<T, bool> predicate) | 85 | public static T Single<T>(IEnumerable<T> collection, Func<T, bool> predicate) |
86 | { | 86 | { |
87 | var results = collection.Where(predicate); | 87 | return collection.Where(predicate).Single(); |
88 | Assert.AreEqual(1, results.Count()); | 88 | } |
89 | |||
90 | public static void All<T>(IEnumerable<T> collection, Func<T, bool> predicate) | ||
91 | { | ||
92 | Assert.IsTrue(collection.All(predicate)); | ||
89 | } | 93 | } |
90 | 94 | ||
91 | public static void Empty<T>(IEnumerable<T> collection) | 95 | public static void Empty<T>(IEnumerable<T> collection) |