-
-
Save Programazing/181a28607fb924f9368a6d68a12a88ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class BigramTests | |
{ | |
[Theory] | |
[TestCaseSource(nameof(Create_ReturnsCorrect_NumberOfBrigams_TestData))] | |
public void Create_ReturnsCorrect_NumberOfBrigams(string input, Dictionary<string, int> actual) | |
{ | |
var sut = Bigram.GetHistogramData(input); | |
sut.Count().Should().Be(actual.Count); | |
} | |
static IEnumerable<object[]> Create_ReturnsCorrect_NumberOfBrigams_TestData() | |
{ | |
var testString = "The quick brown fox and the quick blue hare"; | |
var bigram = new Dictionary<string, int>() | |
{ | |
{ "the quick", 2 }, | |
{ "quick brown", 1 }, | |
{ "brown fox", 1 }, | |
{ "fox and", 1 }, | |
{ "and the", 1 }, | |
{ "quick blue", 1 }, | |
{ "blue hare", 1 } | |
}; | |
return new[] { new object[] { testString, bigram }, }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment