TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vaibhav Singh
NA
132
22.6k
Mock a function using MOQ Framework that accepts a string an
Oct 13 2019 3:17 PM
We have an Interface called IEligibility containing a function called Eligibility
public virtual bool ConsiderAsEligible(string status)
{
bool isEligible = false;
if (status == "Confirmed" || status == "Fake")
{
isEligible = true;
}
return isEligible;
}
So with that said I wrote the below test case which is not working
[TestCase("Confirmed")]
public void Status_is_Confirmed_Then_Eligible(string status)
{
var Eligibility = new Mock<IEligibility>();
Eligibility.Setup(m => m.ConsiderAsEligible(status));
Assert.AreEqual(true, Eligibility .Object.ConsiderAsEligible(status));
}
Reply
Answers (
0
)
Map JSON object to C# class property array
delete from Linq