This is a migrated thread and some comments may be shown as answers.

How to throw a exception after checking string.IsnullorEmpty

1 Answer 75 Views
JustMock Free Edition
This is a migrated thread and some comments may be shown as answers.
Surya
Top achievements
Rank 1
Surya asked on 06 Feb 2020, 03:03 PM
Hi ,

I am actually intended to write a UT  for the following code.
Private void GetVersion(){
string version=GetLatest();
if(string.IsNullOrEmpty(version))
Throw new InvalidException("Ivalid version");

How to write a unit test for the above code?

1 Answer, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 07 Feb 2020, 10:25 AM

Hi Surya,

I have answered in the other thread you have open for the same topic. Here is a link.

Regards,
Mihail
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
JustMock Free Edition
Asked by
Surya
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Share this question
or