public static AllItemsAreInstancesOfType ( IEnumerable collection, Type expectedType ) : void | ||
collection | IEnumerable | IEnumerable containing objects to be considered |
expectedType | Type | System.Type that all objects in collection must be instances of |
Résultat | void |
public void GivenStatementAndWordDictionaryCheckStatementWordSplit(bool removePunctuation, string[] wordDictionary) { var res = "Hello, I am Slava!".ToWordArray(removePunctuation); CollectionAssert.AllItemsAreInstancesOfType(res, typeof(string)); CollectionAssert.AllItemsAreNotNull(res); CollectionAssert.AreEquivalent(res, wordDictionary); }
public void GivenStatementAndWordCountDictionaryCheckCountedWordsInStatement(bool removePunctuation) { var wc = removePunctuation ? wc1 : wc2; var res = "HELLO, HELLO, HELLO, HELLO, HELLO!" .ToWordArray(removePunctuation) .CountWordOccurences(); CollectionAssert.AllItemsAreInstancesOfType(res, typeof(WordCount)); CollectionAssert.AllItemsAreNotNull(res); CollectionAssert.AreEquivalent(res, wc); }