예제 #1
0
        public void GetOperationElements_ValidOperationString_ElementsInQueue()
        {
            var expressionTransformer = new ExpressionTransformer();
            var expectation           = new OperationElementsHelper
            {
                { OperationElementType.Number, "3" },
                { OperationElementType.Operator, "+" },
                { OperationElementType.Number, "2" }
            }.Cast <OperationElement>();

            var result = expressionTransformer.GetOperationElements("3+2");

            Assert.AreEqual(expectation.Select(r => r.ToTestValue()), result.Select(r => r.ToTestValue()));
        }
        public void GetOperationElements_ValidOperationString_ElementsInQueue()
        {
            var expressionTransformer = new ExpressionTransformer();
            var expectation = new OperationElementsHelper
            {
                { OperationElementType.Number,"3" },
                { OperationElementType.Operator, "+"},
                { OperationElementType.Number, "2"}
            }.Cast<OperationElement>();

            var result = expressionTransformer.GetOperationElements("3+2");

            Assert.AreEqual(expectation.Select(r => r.ToTestValue()), result.Select(r => r.ToTestValue()));
        }