Question: In C# , no top level statements Using the following class, create a testing project in Visual Studio. Create a a CalculatorTest class and write
In C# no top level statements
Using the following class, create a testing project in Visual Studio. Create a a CalculatorTest class and write the methods to test each function.
Use the MSTest framework to create your test against the class Calculator. You should test each method. You should turn in one file that follows the naming convention:
All assignments will be cs files; all files should follow this convention: Afile sequence
Create one method per test.
using System;
public class Calculator
Adds two numbers together and returns the result.
public double Adddouble a double b
return a b;
Subtracts the second number from the first and returns the result.
public double Subtractdouble a double b
return a b;
Multiplies two numbers together and returns the result.
public double Multiplydouble a double b
return a b;
Divides the first number by the second and returns the result.
Throws DivideByZeroException if the divisor is zero.
public double Dividedouble a double b
if b
throw new DivideByZeroExceptionDivision by zero is not allowed.";
return a b;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
