コード例 #1
0
        public void ShouldReturnZeroForOverflow()
        {
            int x      = 1534236469;
            int result = new ReverseSignedInteger().ReverseNumberUsingMath(x);

            Assert.Equal(0, result);
        }
コード例 #2
0
        public void ShouldReturnReversedInteger()
        {
            int x      = 12345;
            int result = new ReverseSignedInteger().ReverseSignedInt(x);

            Assert.Equal(54321, result);
        }
コード例 #3
0
        public void ShouldReturnReverseSignedIntUsingMath()
        {
            int x      = -12345;
            int result = new ReverseSignedInteger().ReverseNumberUsingMath(x);

            Assert.Equal(-54321, result);
        }