-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: Nikita_Rybkin
Are you sure you want to change the base?
Nikita rybkin #35
Conversation
{ | ||
Assert.True(true); | ||
} | ||
|
||
[Fact] |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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;}
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Куда делся github actions? Почему проверки не запускаются?
@@ -0,0 +1,76 @@ | |||
namespace CourseApp | |||
{ | |||
public class PigAndSalo |
There was a problem hiding this comment.
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?
CourseApp/Program.cs
Outdated
using System; | ||
|
||
using System; | ||
/* using System.Collections.Generic;*/ |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
CourseApp/Program.cs
Outdated
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 }; |
There was a problem hiding this comment.
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?
public override string Died() | ||
{ | ||
int lard = Lard; | ||
Lard = 0; | ||
return $"{Name} убит\nПолучено {lard} сала\n"; | ||
} |
There was a problem hiding this comment.
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;*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
public override string ToString() | ||
{ | ||
if (lard == 0) | ||
{ | ||
return $"{Name} Без сала\n"; | ||
} | ||
else | ||
{ | ||
return $"Из {Name} можно получить {Lard} сала\n"; | ||
} | ||
} |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот метод тут не нужен (да и в дочерних тоже)
if (value < 0) | ||
{ | ||
weight = 0; | ||
} | ||
else | ||
{ | ||
weight = value; | ||
} |
There was a problem hiding this comment.
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
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; | ||
} |
There was a problem hiding this comment.
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?
No description provided.