Nikita rybkin#35
Conversation
| Assert.True(true); | ||
| } | ||
|
|
||
| [Fact] |
There was a problem hiding this comment.
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]; |
| DateOfDeath = dateOfDeath; | ||
| } | ||
|
|
||
| public string Pig |
There was a problem hiding this comment.
Pig here sinonym to the name? if it does not do anything in get and set - then simply use Pig {get; set;}
jskonst
left a comment
There was a problem hiding this comment.
Куда делся github actions? Почему проверки не запускаются?
| @@ -0,0 +1,76 @@ | |||
| namespace CourseApp | |||
| { | |||
| public class PigAndSalo | |||
There was a problem hiding this comment.
why it's not extends Pig class?
| using System; | ||
|
|
||
| using System; | ||
| /* using System.Collections.Generic;*/ |
There was a problem hiding this comment.
Please - remove all commented code
| { | ||
| int lard = Lard; | ||
| Lard = 0; | ||
| return $"{Name} зарезана\nПолучено {lard} сала\n"; |
| return $"{Name} зарезана\nПолучено {lard} сала\n"; | ||
| } | ||
|
|
||
| public override string MakePhrase(string[] phraseArray) |
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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"; | ||
| } |
| namespace CourseApp | ||
| { | ||
| using System; | ||
| /* using System.Collections.Generic;*/ |
| public override string ToString() | ||
| { | ||
| if (lard == 0) | ||
| { | ||
| return $"{Name} Без сала\n"; | ||
| } | ||
| else | ||
| { | ||
| return $"Из {Name} можно получить {Lard} сала\n"; | ||
| } | ||
| } |
There was a problem hiding this comment.
Прям с любого животного? что-то не так с абстракциями
|
|
||
| public abstract string Died(); | ||
|
|
||
| public abstract string MakePhrase(string[] phraseArray); |
There was a problem hiding this comment.
Этот метод тут не нужен (да и в дочерних тоже)
| if (value < 0) | ||
| { | ||
| weight = 0; | ||
| } | ||
| else | ||
| { | ||
| weight = value; | ||
| } |
There was a problem hiding this comment.
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.
Do we really need that much of constructors?
No description provided.