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
Desi Gal
NA
35
0
how to create a mock dataset and unit test for void method.
May 4 2011 5:40 PM
I have a method whose return type is void. This method has two parameters, a strongly typed datarow and dataset.
private void Check(Dataset testDB, DataRow testRow)
{
if(testRow.Amount>10)
{
decimal rate = testRow.Rate;
if(rate >= 100)
{
AddData(testDB,testRow,"some text");
}
}
}
private void AddData(Dataset testDB, DataRow testRow, string notes)
{
Dataset.StudentRow newRow=testDB.Students.NewStudentRow();
.
.
.
testDB.Students.AddStudentRow(newRow);
}
Reply
Answers (
1
)
ID & Class
popup window