Добавьте файлы проекта.

This commit is contained in:
loc@loc.loc 2024-11-30 12:40:43 +04:00
parent 5e7fc64655
commit 4a3e6b68fa
6 changed files with 123 additions and 0 deletions

31
ConsoleApp7.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp7", "ConsoleApp7\ConsoleApp7.csproj", "{61040B22-EADD-46F3-A628-82CF80B06678}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject1", "TestProject1\TestProject1.csproj", "{F3EB52FA-72CB-4895-802D-70EC77698EB5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{61040B22-EADD-46F3-A628-82CF80B06678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61040B22-EADD-46F3-A628-82CF80B06678}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61040B22-EADD-46F3-A628-82CF80B06678}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61040B22-EADD-46F3-A628-82CF80B06678}.Release|Any CPU.Build.0 = Release|Any CPU
{F3EB52FA-72CB-4895-802D-70EC77698EB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3EB52FA-72CB-4895-802D-70EC77698EB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3EB52FA-72CB-4895-802D-70EC77698EB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3EB52FA-72CB-4895-802D-70EC77698EB5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9808E6F0-1D98-4417-B016-978A64E2CEA0}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

14
ConsoleApp7/Program.cs Normal file
View File

@ -0,0 +1,14 @@
namespace ConsoleApp7
{
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
public static int Test()
{
return -1;
}
}
}

View File

@ -0,0 +1 @@
global using NUnit.Framework;

View File

@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ConsoleApp7\ConsoleApp7.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="SF2022UserNNLib">
<HintPath>C:\Users\Admin\Desktop\dem\SF2022UserNNLib.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

37
TestProject1/UnitTest1.cs Normal file
View File

@ -0,0 +1,37 @@
namespace TestProject1
{
public class Tests
{
[SetUp]
public void Setup()
{
}
[Test]
public void TestSomeMethod()
{
var expect = -1;
var result = ConsoleApp7.Program.Test();
Assert.AreEqual(expect, result);
}
[Test]
public void TestDllLib()
{
string[] expect = {
"08:00-08:30",
"08:30-09:00",
"09:00-09:30",
"09:30-10:00",
"11:30-12:00"
};
TimeSpan[] startTimes = {new TimeSpan(10, 0, 0), new TimeSpan(11, 0, 0)};
int[] durations = { 60, 30 };
TimeSpan beginWorkingTime = new TimeSpan(8, 0, 0);
TimeSpan endWorkingTime = new TimeSpan(12, 0, 0);
int consultationTime = 30;
var result = SF2022UserNNLib.Calculations.AvailablePeriods(startTimes, durations, beginWorkingTime, endWorkingTime, consultationTime);
Assert.AreEqual(expect, result);
}
}
}