public void UnaryOperationExpressionHasProperties()
        {
            var a = JS.Id("a");

            var expression = new UnaryOperationExpression(a, UnaryOperator.Number);

            Assert.AreEqual("+a;", expression.ToString());

            expression.Operator = UnaryOperator.New;

            Assert.AreEqual(UnaryOperator.New, expression.Operator);
            Assert.AreEqual("new a;", expression.ToString());

            expression.Operand = JS.ParseId("Sys.UI.Component");

            Assert.AreEqual("Sys.UI.Component;", expression.Operand.ToString());
            Assert.AreEqual("new Sys.UI.Component;", expression.ToString());
        }
        public void UnaryOperationExpressionHasProperties()
        {
            var a = JS.Id("a");

            var expression = new UnaryOperationExpression(a, UnaryOperator.Number);

            Assert.AreEqual("+a;", expression.ToString());

            expression.Operator = UnaryOperator.New;

            Assert.AreEqual(UnaryOperator.New, expression.Operator);
            Assert.AreEqual("new a;", expression.ToString());

            expression.Operand = JS.ParseId("Sys.UI.Component");

            Assert.AreEqual("Sys.UI.Component;", expression.Operand.ToString());
            Assert.AreEqual("new Sys.UI.Component;", expression.ToString());
        }
        public void UnaryOperationExpressionDetectsUnknownEnumeration()
        {
            var expression = new UnaryOperationExpression(1, (UnaryOperator)int.MaxValue);

            Expect.Throw <InvalidOperationException>(() => expression.ToString());
        }
        public void UnaryOperationExpressionDetectsUnknownEnumeration()
        {
            var expression = new UnaryOperationExpression(1, (UnaryOperator) int.MaxValue);

            Expect.Throw<InvalidOperationException>(() => expression.ToString());
        }