rewrite class and method interface

Introduction You have been assigned responsibility for testing a new feature of an Amazing Calculator. This new feature multiplies two numbers together and can either be executed in process or in the cloud. The CloudService used is an off-the-shelf product and is not required to be functionally tested in isolation. public class AmazingCalculator { public int multiplyMe(int a, int b, bool cloudBasedCalc) { var retVal = 0; if (a == 0 || b == 0) { return retVal; } if (cloudBasedCalc) { return multiplyInTheCloud(a, b); } if (a == 1) { return b; } else if (b == 1) { return a; } for (int count = 0; count < a; count++) { retVal = retVal + b; } return retVal; } // Multiplies two numbers using a remote service private int multiplyInTheCloud(int a, int b) { CloudService cloudService = new CloudService(); int retVal = cloudService.RunCloudBasedMultiplication(a, b); return retVal; } } Exercise 1.Rewrite the class and method interfaces and add additional code to make the whole class 100% branch coverage capable.

Looking for this or a Similar Assignment? Click below to Place your Order

Open chat