예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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");
        }
예제 #4
0
        public void CharTest()
        {
            var testArray = new[] { 'A', 'V', 'I', 'T', 'A', 'V', 'A' };

            var mostFrequent = Analyser.GetMostCommon <char>(testArray);

            Assert.AreEqual(mostFrequent.Item1, 'A');
        }
예제 #5
0
        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);
        }