AllItemsAreInstancesOfType() public static method

Asserts that all items contained in collection are of the type specified by expectedType.
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
return void
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }