Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
darma teja
1.6k
496
317.1k
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