Ejemplo n.º 1
0
        public void Clone_UnaryExpression()
        {
            //Arrange
            var expected = new UnaryExpression(OperatorTypes.Sign, new NumberExpression(0));

            //Act
            var actual = (UnaryExpression)expected.Clone();

            //Assert
            Assert.IsTrue(!Object.ReferenceEquals(actual, expected));
            Assert.AreEqual(actual.Execute().Count.Re.ToNumber(), expected.Execute().Count.Re.ToNumber());
        }
Ejemplo n.º 2
0
        public void Sign_Complex()
        {
            //Arrange
            var expected = new ComplexExpression(-4, -3);
            var c        = new ComplexExpression(4, 3);
            var expr     = new UnaryExpression(OperatorTypes.Sign, c);

            //Act
            var actual = (ComplexExpression)expr.Execute();

            //Assert
            Assert.AreEqual(expected.Count.Re.ToNumber(), actual.Count.Re.ToNumber());
            Assert.AreEqual(expected.Count.Im.ToNumber(), actual.Count.Im.ToNumber());
        }