Exemplo n.º 1
0
        public void Modulo_DoubleByZero_ReturnNan()
        {
            // arrange
            var sp = new ScalarPrimitives <double, double>();

            // action
            var result = sp.Modulo(4.0, 0.0);

            // assert
            Assert.AreEqual(double.NaN, result);
        }
Exemplo n.º 2
0
        public void Modulo_DoubleCase2_ReturnDouble()
        {
            // arrange
            var sp = new ScalarPrimitives <double, double>();

            // action
            var result = sp.Modulo(4.0, 3.0);

            // assert
            Assert.AreEqual(1.0, result);
        }
Exemplo n.º 3
0
        public void Modulo_IntCase2_ReturnInt()
        {
            // arrange
            var sp = new ScalarPrimitives <int, int>();

            // action
            var result = sp.Modulo(4, 3);

            // assert
            Assert.AreEqual(1, result);
        }
Exemplo n.º 4
0
        public void Modulo_IntCase3_ReturnInt()
        {
            // arrange
            var sp = new ScalarPrimitives <int, int>();

            // action
            var result = sp.Modulo(4, -3);

            // assert
            // NOTE: The Python returns -2
            Assert.AreEqual(1, result);
        }