Skip to content

Nikita rybkin#35

Open
Nikrybkin wants to merge 8 commits into
ISUCT:Nikita_Rybkinfrom
Nikrybkin:Nikita_Rybkin
Open

Nikita rybkin#35
Nikrybkin wants to merge 8 commits into
ISUCT:Nikita_Rybkinfrom
Nikrybkin:Nikita_Rybkin

Conversation

@Nikrybkin
Copy link
Copy Markdown

No description provided.

Assert.True(true);
}

[Fact]
Copy link
Copy Markdown
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

Comment thread CourseApp/Function.cs
public double[] TaskA(double xn, double xk, double dx)
{
int g = (int)(((xk - xn) / dx) + 1);
double[] results = new double[g];
Copy link
Copy Markdown
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

Comment thread CourseApp/PigAndSalo.cs
DateOfDeath = dateOfDeath;
}

public string Pig
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

Comment thread CourseApp/PigAndSalo.cs
@@ -0,0 +1,76 @@
namespace CourseApp
{
public class PigAndSalo
Copy link
Copy Markdown
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?

Comment thread CourseApp/Program.cs Outdated
using System;

using System;
/* using System.Collections.Generic;*/
Copy link
Copy Markdown
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

Comment thread CourseApp/Pig.cs
{
int lard = Lard;
Lard = 0;
return $"{Name} зарезана\nПолучено {lard} сала\n";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use multiline strings

Comment thread CourseApp/Pig.cs
return $"{Name} зарезана\nПолучено {lard} сала\n";
}

public override string MakePhrase(string[] phraseArray)
Copy link
Copy Markdown
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?

Comment thread 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 };
Copy link
Copy Markdown
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 thread CourseApp/Bull.cs
Comment on lines +30 to +35
public override string Died()
{
int lard = Lard;
Lard = 0;
return $"{Name} убит\nПолучено {lard} сала\n";
}
Copy link
Copy Markdown
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?

Comment thread CourseApp/Bull.cs
namespace CourseApp
{
using System;
/* using System.Collections.Generic;*/
Copy link
Copy Markdown
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 thread CourseApp/Animals.cs
Comment on lines +101 to +111
public override string ToString()
{
if (lard == 0)
{
return $"{Name} Без сала\n";
}
else
{
return $"Из {Name} можно получить {Lard} сала\n";
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread CourseApp/Animals.cs

public abstract string Died();

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

Choose a reason for hiding this comment

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

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

Comment thread CourseApp/Animals.cs
Comment on lines +50 to +57
if (value < 0)
{
weight = 0;
}
else
{
weight = value;
}
Copy link
Copy Markdown
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 thread CourseApp/Animals.cs
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
Copy Markdown
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