Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do unit testing in C# according to the requirements and examples below. Need to solve Program. Program Create a new Console App (.NET Framework)

Please do unit testing in C# according to the requirements and examples below. Need to solve Program.

Program

Create a new Console App (.NET Framework) Project. Name the project LastName.FirstName.RRCAGTests, where FirstName and LastName correspond to your first and last names.

Name the Visual Studio Solution Assignment2FirstNameLastName, where FirstName and LastName correspond to your first and last names.

Examples

If your name is Dallas Page, the project and solution would be named:

Project: Page.Dallas.RRCAGTests

Solution: Assignment2DallasPage

Copy the LastName.FirstName.Business.dll from the other Visual Studio solution (RRCAGLibraryFirstNameLastName - created above) and put it in the Debug/bin directory of your Console Application. Add a reference to the library (LastName.FirstName.Business.dll) in order to access the library classes.

Program Class

The Program class is generated when you created the Console App (.NET Framework) Project template. Ensure the Program class is in the LastName.FirstName.RRCAGTests namespace.

Program Requirements

Your program will include implementation to test the following members of the Financial class:

+ GetPayment(decimal, int, decimal) : decimal

For each method (unit) being tested, ensure your client program provides output clearly describing the method being tested, along with the expected and actual result.

Each unit test will be written in its own method. Not writing your unit tests in methods will not earn you credit on the assignment.

Each unit test method will test one outcome only.

Each unit test method will be named using the standard outlined in the course material.

When a test fails (actual does not match the expected), correct the method code, then re-test. Keep in mind that a poorly written test can produce inaccurate test results. If a test fails, ensure you have written the test correctly before modifying your unit code.

Output Requirement

For each method (unit) being tested, output the method signature.

For each test, output the following:

Test number

Outcome description

Expected result

Actual result

Leave one blank line between each test.

Sample Output Format

Testing method GetPayment(decimal, int, decimal) Test 1 Expected: The argument cannot be less than 0. Parameter name: rate Actual: The argument cannot be less than 0. Parameter name: rate Test 2 Expected: 526.23 Actual: 526.23 

DO NOT use keyboard input. Hard code all test values.

If a method has more than one outcome, you will require a test for each outcome. Ensure you indicate the test number for each test.

Avoid creating additional methods to reduce repetition in your test application. It is expected that some lines of code will be duplicated.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions