Esempio n. 1
0
        public void GetFullOperation_ThrowsUnrecognizedOperationException()
        {
            var moqOperation = new Mock<IOperation>();
            moqOperation.Setup(operation => operation.StringPresentation).Returns("+");
            var operationsList = new List<IOperation> {moqOperation.Object};
            IRecognizer recognizer = new BaseRecognizer(operationsList);

            Assert.Throws<UnrecognizedOperationException>(() => recognizer.GetFullOperation("-23"));
        }
Esempio n. 2
0
        public void GetFullOperation_ReturnsRecognizedOperation()
        {
            var moqOperation = new Mock<IOperation>();
            moqOperation.Setup(operation => operation.StringPresentation).Returns("+");
            var operationsList = new List<IOperation> {moqOperation.Object};
            IRecognizer recognizer = new BaseRecognizer(operationsList);

            var result = recognizer.GetFullOperation("+56");

            Assert.Equal("+",result);
        }