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

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

            Assert.Null(operService);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }