UNPKG

hellohello234

Version:

Simple calculator API hosted on APIMATIC

42 lines (35 loc) 1.25 kB
/* * hellohello234 * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ) */ 'use strict'; const chai = require('chai'); const assert = chai.assert; const TestHelper = require("../TestHelper"); const APIHelper = require("../../lib/APIHelper"); const testerlib = require("../../lib"); const testConfiguration = require("../TestBootstrap"); const controller = testerlib.SimpleCalculatorController; const OperationTypeEnum = testerlib.OperationTypeEnum; describe("SimpleCalculatorController Tests", function tests() { this.timeout(testConfiguration.TEST_TIMEOUT); /** * Check if multiplication works */ it("should testMultiply response", function testMultiplyTest(done) { // parameters for the API call let input = []; input['operation'] = OperationTypeEnum.MULTIPLY; input['x'] = 4; input['y'] = 5; controller.getCalculate(input, function callback(error, response, context) { // test response code assert.equal(200, context.response.statusCode); assert.isNotNull(response); // not an array, do simple check assert.equal(20, response); done(); }); }); });