public void IntTest() { var testArray = new[] { 3, 4, 5, 3, 3, 1, 3, 7, 8, 3, 2 }; var mostFrequent = Analyser.GetMostCommon <int>(testArray); Assert.AreEqual(mostFrequent.Item1, 3); }
public void DoubleTest() { var testArray = new[] { 1.2D, 3.4D, 5D, 2D, 1.2D }; var mostFrequent = Analyser.GetMostCommon <double>(testArray); Assert.AreEqual(mostFrequent.Item1, 1.2D); }
public void StringTest() { var testArray = new[] { "Assen", "Valia", "Iana", "Tsveta", "Alex", "Assen", "Valia", "Assen" }; var mostFrequent = Analyser.GetMostCommon <string>(testArray); Assert.AreEqual(mostFrequent.Item1, "Assen"); }
public void CharTest() { var testArray = new[] { 'A', 'V', 'I', 'T', 'A', 'V', 'A' }; var mostFrequent = Analyser.GetMostCommon <char>(testArray); Assert.AreEqual(mostFrequent.Item1, 'A'); }
static void Main(string[] args) { var testIntArray = new[] { 3, 4, 5, 3, 3, 1, 3, 7, 8, 3, 2 }; var mostFrequentInt = Analyser.GetMostCommon <int>(testIntArray); var testStringArray = new[] { "Assen", "Valia", "Iana", "Tsveta", "Alex", "Assen", "Valia", "Assen" }; var mostFrequentString = Analyser.GetMostCommon <string>(testStringArray); }