Example #1
0
        public void EmaSingle_SimpleValues_Calculated()
        {
            //When
            var result = _ma.EmaSingle(_data2, 5).Value;

            //Then
            Assert.Equal(1328.45D, result, 2);
        }
Example #2
0
        public void EmaSingle_PeriodZeroOrLess_ReturnNull()
        {
            //Given
            var ma = new MA();

            //When
            var result  = ma.EmaSingle(data2, 0);
            var result2 = ma.EmaSingle(data2, -10);

            //Then
            Assert.Null(result);
            Assert.Null(result2);
        }
Example #3
0
        public void EmaSingle_NullData_ReturnNull()
        {
            //Given
            var ma = new MA();

            //When
            var result = ma.EmaSingle(null, 1000);

            //Then
            Assert.Null(result);
        }
Example #4
0
        public void EmaSingle_PeriodBiggerThanDataLength_ReturnNull()
        {
            //Given
            var ma = new MA();

            //When
            var result = ma.EmaSingle(data2, 1000);

            //Then
            Assert.Null(result);
        }
Example #5
0
        public void EmaSingle_SimpleValues_Calculated()
        {
            //Given
            var ma = new MA();

            //When
            var result = Math.Round(ma.EmaSingle(data2, 5).Value, 2);

            //Then
            Assert.Equal(1328.45D, result);
        }