Beispiel #1
0
        private static DecimalType ConvertFrom(object o)
        {
            var type = new DecimalType();

            type.SetValue(o);
            return(type);
        }
Beispiel #2
0
        private static T ConvertTo <T>(DecimalType type)
        {
            if (type == null)
            {
                return(default(T));
            }

            return(type.GetValue <T>());
        }
        public void BigDecimal_To_JavaBytes()
        {
            // arrange

            // act
            DecimalType actual = bigDecimal;

            // assert
            Assert.True(actual.ToBigEndian().SequenceEqual(javaByteOrder));
        }
        public void Implicit_BigDecimal_Cast()
        {
            // arrange
            BigDecimal expected = bigDecimal;

            // act
            DecimalType actual = expected;

            // assert
            Assert.Equal(expected, (BigDecimal)actual);
        }
        public void JavaBytes_To_BigDecimal()
        {
            // arrange

            // act
            DecimalType actual = new DecimalType();

            actual.SetValueFromBigEndian(javaByteOrder);

            // assert
            Assert.Equal(bigDecimal, (BigDecimal)actual);
        }
        public void Operator_NotEqualTo()
        {
            // arrange
            var         value = bigDecimal;
            DecimalType type  = value;

            // act
            bool actual = !type.Equals(value);

            // assert
            Assert.False(actual);
        }
        public void CassandraType_Cast()
        {
            // arrange
            BigDecimal  expected   = bigDecimal;
            DecimalType actualType = expected;

            // act
            CassandraObject actual = actualType;

            // assert
            Assert.Equal(expected, (BigDecimal)actual);
        }
        public void Implicit_ByteArray_Cast()
        {
            // arrange
            byte[] expected = dotNetByteOrder;

            // act
            DecimalType actualType = expected;

            byte[] actual = actualType;

            // assert
            Assert.True(expected.SequenceEqual(actual));
        }