Vladislav savchenko#32
Conversation
| Assert.Equal(res, new double[5]); | ||
| } | ||
| [Theory] | ||
| [InlineData(2.0, 1.2, 4.2, 0.6)] |
There was a problem hiding this comment.
🔕 для 1 теста не надо такое писать - просто Fact, а все остальное внутри теста
| var result = new int[resultA.Length]; | ||
| foreach (var item in resultA) | ||
| { | ||
| result[k] = (int)Math.Floor(resultA[k]*1000); |
There was a problem hiding this comment.
Зачем это умножение на 1000?
| result[k] = (int)Math.Floor(resultA[k]*1000); | ||
| k++; | ||
| } | ||
| var exp = new int[] {24, 23, 21, 19, 17}; |
There was a problem hiding this comment.
Для этой задачи можно проверить просто число элементов в массиве, при условии того, что сама функция протестирована
| { | ||
| Dog snech = new Dog(); | ||
| Assert.Equal( | ||
| @" __ _ |
There was a problem hiding this comment.
я чего у вас собачку как скукожило?
| <TargetFramework>netcoreapp2.1</TargetFramework> | ||
| <TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
| <TargetFramework>netcoreapp2.0</TargetFramework> | ||
| <TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
| Pol = n; | ||
| if (Pol == "S") | ||
| { | ||
| Age = 12; |
There was a problem hiding this comment.
А где конструктор с теми параметрами, который я хочу - а вы мне генерируете собак пенсионного возраста ?
|
|
||
| public void GetInfo() | ||
| { | ||
| Console.WriteLine($"Пол: {Pol} Возраст: {Age} Вес: {Weight}"); |
There was a problem hiding this comment.
Замените getInfo на перекрытие toString
| @@ -1,206 +0,0 @@ | |||
| # Download this file using PowerShell v3 under Windows with the following comand: | |||
| } | ||
| return y; | ||
| } | ||
| public static double[] TaskB(double a, double[] x) |
There was a problem hiding this comment.
Уже переписывайте на использование списков
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp2.1</TargetFramework> | ||
| <TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
| <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
| public void Test1() | ||
| { | ||
| Assert.True(true); | ||
| Xunit.Assert.True(true); |
|
|
||
| public void TestTaskA(double a, double xn, double xk, double dx) | ||
| { | ||
| var res = Program.TaskA(a, xn, xk, dx); |
There was a problem hiding this comment.
А тест нормального выполнения функции?
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp2.1</TargetFramework> | ||
| <TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
| <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
|
|
||
| public void AgeUp() | ||
| { | ||
| this.age++; |
There was a problem hiding this comment.
Устанавливать надо свойство а не поле
No description provided.