ToString() public method

Returns a String that represents this instance.
public ToString ( ) : string
return string
Ejemplo n.º 1
0
        public void ZeroImToStringTest()
        {
            var token = new ComplexNumberResult(new Complex(5.3, 0));

            Assert.Equal("5.3", token.ToString());
        }
Ejemplo n.º 2
0
        public void PositiveReToStringTest()
        {
            var token = new ComplexNumberResult(new Complex(5.3, 2.12));

            Assert.Equal("5.3+2.12i", token.ToString());
        }
Ejemplo n.º 3
0
        public void ImOneToStringTest()
        {
            var token = new ComplexNumberResult(new Complex(0, 1));

            Assert.Equal("i", token.ToString());
        }
Ejemplo n.º 4
0
        public void NegativeReToStringTest()
        {
            var token = new ComplexNumberResult(new Complex(-5.3, -2.12));

            Assert.Equal("-5.3-2.12i", token.ToString());
        }
Ejemplo n.º 5
0
        public void ZeroReToStringTest()
        {
            var token = new ComplexNumberResult(new Complex(0, 1.3));

            Assert.Equal("1.3i", token.ToString());
        }