-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed the access modificators and wrote the tests for my case
- Loading branch information
Showing
3 changed files
with
49 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dotnet build ./src/src.sln && dotnet build ./tests/ && dotnet test --no-build --verbosity normal ./tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
using Xunit; | ||
using struct_lab_student; | ||
|
||
namespace student_tests { | ||
public partial class Tests { | ||
namespace student_tests | ||
{ | ||
public partial class Tests | ||
{ | ||
[Fact] | ||
public static void Student_Constructor_ReturnStudentList() { | ||
public static void Student_Constructor_ReturnStudentList() | ||
{ | ||
List<Student> students = []; | ||
students.Add(new("Прізвище1 Ім'я1 По-батькові1 M 02.02.2000 3 4 5 1234")); | ||
students.Add(new("surname FIRST_NAME 🔥 F 02.02.2000 4 - 2 1234")); | ||
students.Add(new("1 2 3 4 5 - - - 6")); | ||
Console.WriteLine(students.Count < 3 ? "this is a test, stupid" : "no way!"); | ||
} | ||
|
||
[Fact] | ||
public static void TestVar10() | ||
{ | ||
List<Student> students = []; | ||
students.Add(new("Андрущенко Вадим Миколайович M 23.06.2004 2 1 - 1285")); | ||
students.Add(new("Стакан Єгор Олександрович Ч 04.01.2006 4 5 3 4319")); | ||
students.Add(new("Кірпіч Влад Шварцович Ч 12.06.1998 4 4 5 3538")); | ||
students.Add(new("Муха Саня Респектович F 12.11.1999 3 5 4 3392")); | ||
|
||
int count = 0; | ||
foreach (Student student in students) | ||
{ | ||
if (Program.IsTalentedPhysician(student)) | ||
count++; | ||
} | ||
Assert.Equal(2, count); | ||
|
||
double[] expectedAverages = { 1.7, 4.0, 4.3, 4.0 }; | ||
int counter = 0; | ||
foreach (var student in students) | ||
{ | ||
Assert.Equal(Program.EvalAverage(student), expectedAverages[counter]); | ||
counter++; | ||
} | ||
} | ||
} | ||
} | ||
} |