Exemplo n.º 1
0
        public void NotFoundService_WhenSendUnknownOperation()
        {
            string operation = "h2";

            var factory     = new OperationFactory.OperationFactory();
            var operService = factory.GetOperation(operation);

            Assert.Null(operService);
        }
Exemplo n.º 2
0
        public void GetAddOperationService_WhenSendAddOperation()
        {
            string operation = "+";

            var factory     = new OperationFactory.OperationFactory();
            var operService = factory.GetOperation(operation);

            Assert.NotNull(operService);
            Assert.IsType <AddOperation>(operService);
        }
Exemplo n.º 3
0
        public void ExpOperationService_WhenSendSubOperation()
        {
            string operation = "^";

            var factory     = new OperationFactory.OperationFactory();
            var operService = factory.GetOperation(operation);

            Assert.NotNull(operService);
            Assert.IsType <ExpOperation>(operService);
        }
Exemplo n.º 4
0
        public async Task GetCorrectResult_DivisionOperation(double left, double right, double result)
        {
            string operation = "/";

            var factory     = new OperationFactory.OperationFactory();
            var operService = factory.GetOperation(operation);
            var operRes     = await operService.Calc(left, right);

            Assert.Equal(operRes, result, 5);
        }