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
darma teja
NA
496
338.7k
unit test for the following code
Oct 10 2017 2:36 AM
public
static
class
myValidationExt
{
public
static
IRuleBuilderOptions
onlyPositive
(
this
IRuleBuilder
ruleBuilder)
where TProperty :
struct
, IComparable
, IComparable
{
return
ruleBuilder.GreaterThan(
default
(TProperty)).WithMessage(
"StudentId should only be greater than zero"
);
}
}
[Test]
[ExpectedException(
typeof
(Exception), ExpectedMessage =
"
StudentId should only be greater than zero
"
)]
public
void
Positive_Valuelessthanzero_ValidationPassed()
{
//Arrange
Thread.CurrentThread.CurrentCulture =
new
CultureInfo(
"en-us"
);
//Act
var myString = myValidationExt.onlyPositive(*******);
// How to pass the parameter???
//Assert
}
Reply
Answers (
1
)
How to change button color of form1 by clicking form2 button
How to find translate point for zoomed -in view