Skip to content

Conversation

MrWin3er
Copy link

@MrWin3er MrWin3er commented Jan 7, 2020

No description provided.

[Fact]
public void TestAge()
{
Assert.Equal("Вам 19 лет, 4 месяцев и 18 дня", AgeClass.Age(21, 8, 2000));
Copy link
Collaborator

Choose a reason for hiding this comment

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

А через год тест сломается, тестировать надо или используя Mock или метод, в котором 2 параметра - дата С и дата По

{
public static string Age(int days, int months, int years)
{
DateTime res = DateCompare(new DateTime(years, months, days), DateTime.Now);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Добавьте метод (который и сможете протестировать) который получает 2 параметра - дату С и дату По

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