Skip to content

Медников Матвей#46

Open
easyThingsLover wants to merge 2 commits into
kontur-courses:masterfrom
easyThingsLover:master
Open

Медников Матвей#46
easyThingsLover wants to merge 2 commits into
kontur-courses:masterfrom
easyThingsLover:master

Conversation

@easyThingsLover

Copy link
Copy Markdown

No description provided.

ClassicAssert.IsFalse(new NumberValidator(17, 2, true).IsValidNumber("0.000"));
ClassicAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber("-1.23"));
ClassicAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber("a.sd"));
ClassicAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber("a.sd"));*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Дропни комменты, пожалуйста

[TestCase(4, 2, false, null, false)]
public void IsValidNumber_ReturnExpectedResult(int precision, int scale, bool onlyPositive, string input, bool expected)
{
new NumberValidator(precision, scale, onlyPositive).IsValidNumber(input).Should().Be(expected);

@Inree Inree Oct 29, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подушню. Вместо отдельного параметра Expected можно использовать ExpectedResult, встроенный в атрибут TestCase. То есть ты можешь описать

TestCase(17, 2, true, "0.0", ExpectedResult = true)
bool Test(parameters)
{
return TestedModule.TestedMethod(parameters);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants