-
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.
- Loading branch information
Showing
3 changed files
with
72 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/bin | ||
/obj | ||
/tests/bin | ||
/tests/obj | ||
/src/bin | ||
/src/obj | ||
.vscode | ||
*.sln |
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,50 @@ | ||
using Xunit; | ||
using struct_lab_student; | ||
|
||
namespace student_tests { | ||
public partial class Tests { | ||
[Fact] | ||
public static void Student_EvalAverages_ReturnDoubleList() { | ||
try | ||
{ | ||
Student a = new("Прізвище1 Ім'я1 По-батькові1 F 02.02.2000 4 4 - 1234"); | ||
Student b = new("Прізвище2 Ім'я2 По-батькові2 F 02.02.2000 4 - 2 1234"); | ||
Student c = new("Прізвище3 Ім'я3 По-батькові3 F 03.03.2000 3 - - 2413"); | ||
List<double> avgs = Program.EvalAverages([a,b,c]); | ||
bool fail = false; | ||
foreach (double avg in avgs) { | ||
if (avg < 2.0) { | ||
fail = true; | ||
break; | ||
} | ||
} | ||
Console.WriteLine(fail ? "Student_EvalAverages_ReturnDoubleList epic fail!!!" : "cool!"); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine($"\n\n uhoh somethin dun gone wrong! \n {e} \n\n"); | ||
} | ||
} | ||
[Fact] | ||
public static void Student_EvalAverages_ReturnDoubleList() { | ||
try | ||
{ | ||
Student a = new("Прізвище1 Ім'я1 По-батькові1 F 02.02.2000 4 4 - 1234"); | ||
Student b = new("Прізвище2 Ім'я2 По-батькові2 F 02.02.2000 4 - 2 1234"); | ||
Student c = new("Прізвище3 Ім'я3 По-батькові3 F 03.03.2000 3 - - 2413"); | ||
List<double> avgs = Program.EvalAverages([a,b,c]); | ||
bool fail = false; | ||
foreach (double avg in avgs) { | ||
if (avg < 2.0) { | ||
fail = true; | ||
break; | ||
} | ||
} | ||
Console.WriteLine(fail ? "Student_EvalAverages_ReturnDoubleList epic fail!!!" : "cool!"); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine($"\n\n uhoh somethin dun gone wrong! \n {e} \n\n"); | ||
|
||
} | ||
} |
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,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>disable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" /> | ||
<PackageReference Include="xunit" Version="2.8.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8" /> | ||
<Reference Include="../src/bin/Debug/net8.0/lab4.dll" /> | ||
</ItemGroup> | ||
|
||
|
||
</Project> |