Beispiel #1
0
        public void Coerce_ToInt64FromLarger()
        {
            decimal expected = 10;

            //Act
            TypeConversion.Coerce <long>(expected);
        }
Beispiel #2
0
        public void Coerce_ToUInt32FromLarger()
        {
            long expected = 10;

            //Act
            TypeConversion.Coerce <uint>(expected);
        }
Beispiel #3
0
        public void Coerce_ToSByteFromByte()
        {
            byte expected = 10;

            //Act
            TypeConversion.Coerce <sbyte>(expected);
        }
Beispiel #4
0
        public void Coerce_ToSByteFromLarger()
        {
            int expected = 10;

            //Act
            TypeConversion.Coerce <byte>(expected);
        }
Beispiel #5
0
        public void Coerce_ToSingleFromDouble()
        {
            double expected = 10;

            //Act
            TypeConversion.Coerce <float>(expected);
        }
Beispiel #6
0
        public void Coerce_ToUInt16FromLarger()
        {
            int expected = 10;

            //Act
            TypeConversion.Coerce <ushort>(expected);
        }
Beispiel #7
0
        public void Coerce_ToDoubleFromLarger()
        {
            decimal expected = 10;

            //Act
            TypeConversion.Coerce <double>(expected);
        }
Beispiel #8
0
        public void Coerce_ToInt64FromUInt64()
        {
            ulong expected = 10;

            //Act
            TypeConversion.Coerce <long>(expected);
        }
Beispiel #9
0
        public void Coerce_ToInt32FromUInt32()
        {
            uint expected = 10;

            //Act
            TypeConversion.Coerce <int>(expected);
        }
Beispiel #10
0
        public void Coerce_ToInt16FromUInt16()
        {
            ushort expected = 10;

            //Act
            TypeConversion.Coerce <short>(expected);
        }
Beispiel #11
0
        public void Coerce_ToSingleeFromLarger()
        {
            decimal expected = 10;

            //Act
            TypeConversion.Coerce <float>(expected);
        }
Beispiel #12
0
        public void Coerce_ToSingleFromSingle()
        {
            float expected = 10;

            //Act
            var actual = TypeConversion.Coerce <float>(expected);

            //Assert
            actual.Should().BeApproximately(expected);
        }
Beispiel #13
0
        public void Coerce_ToSingleFromUInt64()
        {
            ulong expected = 10;

            //Act
            var actual = TypeConversion.Coerce <float>(expected);

            //Assert
            actual.Should().BeExactly((int)expected);
        }
Beispiel #14
0
        public void Coerce_ToSingleFromInt32()
        {
            int expected = 10;

            //Act
            var actual = TypeConversion.Coerce <float>(expected);

            //Assert
            actual.Should().BeExactly(expected);
        }
Beispiel #15
0
        public void Coerce_ToDoubleFromSByte()
        {
            sbyte expected = 10;

            //Act
            var actual = TypeConversion.Coerce <double>(expected);

            //Assert
            actual.Should().BeExactly(expected);
        }
Beispiel #16
0
        public void Coerce_ToUInt32FromUInt32()
        {
            uint expected = 10;

            //Act
            var actual = TypeConversion.Coerce <uint>(expected);

            //Assert
            actual.Should().Be((uint)expected);
        }
Beispiel #17
0
        public void Coerce_ToInt64FromInt64()
        {
            long expected = 10;

            //Act
            var actual = TypeConversion.Coerce <long>(expected);

            //Assert
            actual.Should().Be(expected);
        }
Beispiel #18
0
        public void Coerce_ToInt32FromUInt16()
        {
            ushort expected = 10;

            //Act
            var actual = TypeConversion.Coerce <int>(expected);

            //Assert
            actual.Should().Be(expected);
        }
Beispiel #19
0
        public void Coerce_ToInt16FromByte()
        {
            byte expected = 10;

            //Act
            var actual = TypeConversion.Coerce <short>(expected);

            //Assert
            actual.Should().Be(expected);
        }
Beispiel #20
0
        public void Coerce_ToDoubleFromInt64()
        {
            long expected = 10;

            //Act
            var actual = TypeConversion.Coerce <double>(expected);

            //Assert
            actual.Should().BeExactly((int)expected);
        }
Beispiel #21
0
        public void Coerce_ToUInt16FromInt16()
        {
            short expected = 10;

            //Act
            var actual = TypeConversion.Coerce <ushort>(expected);

            //Assert
            actual.Should().Be((ushort)expected);
        }
Beispiel #22
0
        public void Coerce_ToSByteFromSByte()
        {
            sbyte expected = 10;

            //Act
            var actual = TypeConversion.Coerce <sbyte>(expected);

            //Assert
            actual.Should().Be(expected);
        }
Beispiel #23
0
        public void Coerce_ToDoubleFromUInt16()
        {
            ushort expected = 10;

            //Act
            var actual = TypeConversion.Coerce <double>(expected);

            //Assert
            actual.Should().BeExactly(expected);
        }
Beispiel #24
0
        public void Coerce_ToDoubleFromDouble()
        {
            double expected = 10;

            //Act
            var actual = TypeConversion.Coerce <double>(expected);

            //Assert
            actual.Should().BeApproximately(expected);
        }
Beispiel #25
0
        public void Coerce_ToUInt64FromUInt16()
        {
            ushort expected = 10;

            //Act
            var actual = TypeConversion.Coerce <ulong>(expected);

            //Assert
            actual.Should().Be((ulong)expected);
        }
Beispiel #26
0
        public void Coerce_ToDecimalFromDecimal()
        {
            decimal expected = 10;

            //Act
            var actual = TypeConversion.Coerce <decimal>(expected);

            //Assert
            actual.Should().Be(expected);
        }
Beispiel #27
0
        public void Coerce_ToDecimalFromUInt16()
        {
            ushort expected = 10;

            //Act
            var actual = TypeConversion.Coerce <decimal>(expected);

            //Assert
            actual.Should().BeExactly((int)expected);
        }
Beispiel #28
0
        public void Coerce_ToUInt64FromByte()
        {
            byte expected = 10;

            //Act
            var actual = TypeConversion.Coerce <ulong>(expected);

            //Assert
            actual.Should().Be(expected);
        }
Beispiel #29
0
 public void Coerce_ToUInt32FromOther()
 {
     //Act
     TypeConversion.Coerce <uint>("456");
 }
Beispiel #30
0
 public void Coerce_ToUInt16FromOther()
 {
     //Act
     TypeConversion.Coerce <ushort>("456");
 }