Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys

I have a rating engine which was implemented into our project, before we decided to implement unit testing into our solution the engine was built.

So basically how our ratting engine algorithm works is we pass an id value to it, there are methods in the engine which will load the client data and then rating gets calculated based on a couple methods of true/false age etc which is captured at UI level.

I would like to have a some links or some guidance into the correct direction of what kind of testing would be implemented

What I have tried:

I have looked into Nunit as well as Moq framework to present moq data, when the tests runs
Posted
Updated 2-Sep-18 21:25pm
Comments
F-ES Sitecore 3-Sep-18 4:41am    
Unless the code has been written with unit testing in mind it is often not testable, not easily anyway. You'd have to post some samples of the code you want to test to see if anyone can advise.

1 solution

Also tease out some interfaces for the classes used in your code and pass the concrete implementations in as part of the constructors - that way you can replace these with mock classes in your unit tests to isolate the bit of the code you are testing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900