Ejemplo n.º 1
0
        public void Amount_Sample_5()
        {
            var values = new[] { -5, -3, 0, 1, 3, 6 };
            var amount = new AbsDistinct().Amount(values);

            amount.Should().Be(5);
        }
        public void CountValuesShouldReturnDistinctAbsoluteOnes(int[] a, int expected)
        {
            AbsDistinct counter = new AbsDistinct();
            int         actual  = counter.Count(a);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void Amount_TwoItems_2()
        {
            var values = new[] { -5, 3 };
            var amount = new AbsDistinct().Amount(values);

            amount.Should().Be(2);
        }
Ejemplo n.º 4
0
        public void Amount_OneItemNegativeInt_1()
        {
            var values = new[] { int.MinValue };
            var amount = new AbsDistinct().Amount(values);

            amount.Should().Be(1);
        }
Ejemplo n.º 5
0
        public void Amount_OneItem_1()
        {
            var values = new[] { -5 };
            var amount = new AbsDistinct().Amount(values);

            amount.Should().Be(1);
        }
Ejemplo n.º 6
0
        public void Amount_TheSame_1()
        {
            var values = new[] { 5, 5, 5, 5, 5, 5 };
            var amount = new AbsDistinct().Amount(values);

            amount.Should().Be(1);
        }
Ejemplo n.º 7
0
        public void Amount_Empty_0()
        {
            var values = new int[0];
            var amount = new AbsDistinct().Amount(values);

            amount.Should().Be(0);
        }