Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nikita rybkin #35

Open
wants to merge 8 commits into
base: Nikita_Rybkin
Choose a base branch
from
Open

Conversation

Nikrybkin
Copy link

No description provided.

{
Assert.True(true);
}

[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please - use Inline data to check multiple cases

public double[] TaskA(double xn, double xk, double dx)
{
int g = (int)(((xk - xn) / dx) + 1);
double[] results = new double[g];
Copy link
Contributor

Choose a reason for hiding this comment

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

🔕 - you may use List

DateOfDeath = dateOfDeath;
}

public string Pig
Copy link
Contributor

Choose a reason for hiding this comment

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

Pig here sinonym to the name? if it does not do anything in get and set - then simply use Pig {get; set;}

Copy link
Contributor

Choose a reason for hiding this comment

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

@Nikrybkin please fix this one

Copy link
Contributor

@jskonst jskonst left a comment

Choose a reason for hiding this comment

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

Куда делся github actions? Почему проверки не запускаются?

@Nikrybkin
Copy link
Author

@@ -0,0 +1,76 @@
namespace CourseApp
{
public class PigAndSalo
Copy link
Contributor

Choose a reason for hiding this comment

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

why it's not extends Pig class?

using System;

using System;
/* using System.Collections.Generic;*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Please - remove all commented code

{
int lard = Lard;
Lard = 0;
return $"{Name} зарезана\nПолучено {lard} сала\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

use multiline strings

return $"{Name} зарезана\nПолучено {lard} сала\n";
}

public override string MakePhrase(string[] phraseArray)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this one belong to Pig class?

Pig pigTwo = new Pig("Бычок", 9, 99);
Bull boarOne = new Bull("Бычок 1", 1, 5, 7);
Bull boarTwo = new Bull("Бычок 2", 3, 2, 8);
Animals[] animals = new Animals[] { pigOne, pigTwo, boarOne, boarTwo };
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add some common method for all Animals and call it in the loop?

Comment on lines +30 to +35
public override string Died()
{
int lard = Lard;
Lard = 0;
return $"{Name} убит\nПолучено {lard} сала\n";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

? Сало? same as for pig?

namespace CourseApp
{
using System;
/* using System.Collections.Generic;*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented code

Comment on lines +101 to +111
public override string ToString()
{
if (lard == 0)
{
return $"{Name} Без сала\n";
}
else
{
return $"Из {Name} можно получить {Lard} сала\n";
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Прям с любого животного? что-то не так с абстракциями


public abstract string Died();

public abstract string MakePhrase(string[] phraseArray);
Copy link
Contributor

Choose a reason for hiding this comment

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

Этот метод тут не нужен (да и в дочерних тоже)

Comment on lines +50 to +57
if (value < 0)
{
weight = 0;
}
else
{
weight = value;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's throw exception here

Comment on lines +12 to +33
public Animals()
: this("неизвестного животного", 10, 12, 13)
{
}

public Animals(string name, int weight)
: this(name, weight, 0, 0)
{
}

public Animals(string name, int weight, int lard)
: this(name, weight, 0, lard)
{
}

public Animals(string name, int weight, int age, int lard)
{
Name = name;
Lard = lard;
Age = age;
Weight = weight;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need that much of constructors?

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