-
Notifications
You must be signed in to change notification settings - Fork 23
Anastasija zajtseva #31
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
base: Anastasija_Zajtseva
Are you sure you want to change the base?
Conversation
| # Course of c# | ||
|
|
||
| Please write your name and surname here No newline at end of file | ||
| ��������� ������� No newline at end of file |
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.
Можо каким-то другим редактором поддреживающим кодировку?
laba2/Program.cs
Outdated
| } | ||
| static double Fan(double x) | ||
| { | ||
| double a = 0.1; |
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.
a и b следует также вынести в параметры функции
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.
Так и не изменено :(
laba2/Program.cs
Outdated
| double a = 0.1; | ||
| double b = 0.5; | ||
| double y; | ||
| y = ((a + (Math.Tan(b * x)) * (Math.Tan(b * x))) / (b + (1 / (Math.Tan(a * x))) * (1 / (Math.Tan(a * x))))); |
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.
А зачем так разделять?
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.
Объедините объявление и присвоение
jskonst
left a comment
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.
Переместите код из Laba_2 в CourseApp - можно прямо в ProgramCS
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.
Уберите все ненужные файлы
test/UnitTest1.cs
Outdated
| public void Test1() | ||
| { | ||
| City ivanovo = new City(); | ||
| var res_country = ivanovo.Country; |
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.
А зачем вы временные переменные создаете? это как бы не обязательно
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.
А вот стиль названия с _ в имени - не принят - поправьте
test/UnitTest1.cs
Outdated
| Assert.Equal(9000, res_population); | ||
| Assert.Equal("Ïèòåð", res_name); | ||
| } | ||
| [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.
Это почему тут осталось?
CourseApp/City.cs
Outdated
| } | ||
| } | ||
|
|
||
| public City() { Name = "Иваново"; Country = "Россия"; population = 316; } // 1 конструктор |
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.
Переиспользуйте конструктор - данный донструктор без параметров должен вызвать основной констурктор, передав ему все параметры
CourseApp/City.cs
Outdated
| { | ||
| population += pop; | ||
| } | ||
| public void Ueh() |
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.
Неее - вот первых - у какого города бы не выбрал метот - погибнет Иваново... Поэтому переделайет на общий случай - имя возьмите из свойств объекта
CourseApp.Tests/UnitTest1.cs
Outdated
|
|
||
| public class UnitTest1 | ||
| { | ||
| public object Assert { get; private 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.
Вот корень всего зла, зачем добавили? я понимаю что Studio предложила и согласились сгенерировать...
CourseApp.Tests/UnitTest1.cs
Outdated
| @@ -0,0 +1,61 @@ | |||
| namespace Test | |||
| { | |||
| using System; | |||
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.
это вроде бы как за пределы пространства имен, но если ругаться е будет, то ок
CourseApp.Tests/UnitTest1.cs
Outdated
| var rescountry = ivanovo.Country; | ||
| var respopulation = ivanovo.Population ; | ||
| var resname = ivanovo.Name; | ||
| Assert.Equal("Ðîññèÿ", rescountry); |
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.
можно сразу сравнивать с ivanovo.Country - зачем вам строчки выше?
| [Fact] | ||
| public void Test4() | ||
| { | ||
| var res = Program.Formula(0.1, 0.5, 0.15); |
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.
Эти тесты должны быть в отдельном файле
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.
Это упорно игнорируете :(
CourseApp/City.cs
Outdated
| Console.WriteLine($"Название: {Name} Страна: {Country} Популяция: {population}"); | ||
| } | ||
|
|
||
| public void Addpopulation(int pop) |
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.
правильее назвать AddPopulation - в camelCase - второе слово тоже сбольшой буквы
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.
у нас все таки CamelCase - AddPopulation а не AddPopulation
CourseApp/City.cs
Outdated
|
|
||
| public string Dead() | ||
| { | ||
| return $"Всё население города {Name} вымерло из-за аварии на АЭС."; |
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.
А если после вызова метода я спрошу про population?
Fixed problems with tests
|
|
||
| public string Name { get; set; } | ||
| { | ||
| public class City |
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.
Воу воу - сразу нет - 1 файл 1 класс
jskonst
left a comment
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.
Да и код не компилируется :( . А о чем мы договаривались - код в git'e как миимум компилируется :(
No description provided.