コード例 #1
0
        public void PositiveReToStringTest()
        {
            var token = new ComplexNumberToken(new Complex(5.3, 2.12));

            Assert.Equal("Complex Number: 5.3+2.12i", token.ToString());
        }
コード例 #2
0
        public void ZeroReToStringTest()
        {
            var token = new ComplexNumberToken(new Complex(0, 1.3));

            Assert.Equal("Complex Number: 1.3i", token.ToString());
        }
コード例 #3
0
        public void ZeroImToStringTest()
        {
            var token = new ComplexNumberToken(new Complex(5.3, 0));

            Assert.Equal("Complex Number: 5.3", token.ToString());
        }
コード例 #4
0
        public void NegativeImToStringTest()
        {
            var token = new ComplexNumberToken(new Complex(5.3, -2.12));

            Assert.Equal("Complex Number: 5.3-2.12i", token.ToString());
        }
コード例 #5
0
        public void ImNegOneToStringTest()
        {
            var token = new ComplexNumberToken(new Complex(0, -1));

            Assert.Equal("Complex Number: -i", token.ToString());
        }