public void CanFitTransformData() { // arrange var target = new CountVectorizer(); var trainingData = GetTrainingData(); var expected = new List <IDictionary <string, uint> > { new Dictionary <string, uint> { { "somebody", 1 }, { "once", 1 }, { "told", 1 }, { "me", 2 }, { "the", 1 }, { "world", 1 }, { "is", 1 }, { "gonna", 1 }, { "roll", 1 }, { "i", 0 }, { "ain't", 0 }, { "sharpest", 0 }, { "tool", 0 }, { "in", 0 }, { "shed", 0 } }, new Dictionary <string, uint> { { "i", 1 }, { "ain't", 1 }, { "the", 2 }, { "sharpest", 1 }, { "tool", 1 }, { "in", 1 }, { "shed", 1 }, { "somebody", 0 }, { "once", 0 }, { "told", 0 }, { "me", 0 }, { "world", 0 }, { "is", 0 }, { "gonna", 0 }, { "roll", 0 } }, }; // act var res = target.FitTransform(trainingData); // assert Assert.NotNull(res); Assert.Equal(expected, res); }