init commit

This commit is contained in:
Ivan 2025-03-06 13:38:46 +03:00
parent 8708167f35
commit c61b309513
18 changed files with 1483 additions and 0 deletions

28
Testiks/Testiks.csproj Normal file
View File

@ -0,0 +1,28 @@
<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="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Libary\Libary.csproj" />
</ItemGroup>
</Project>

85
Testiks/UnitTest1.cs Normal file
View File

@ -0,0 +1,85 @@
using NUnit.Framework;
using System;
using Libary;
namespace Testiks
{
public class Tests
{
[SetUp]
public void Setup()
{
}
[Test]
public void TestNoBusyPeriods()
{
Calculations calculations = new Calculations();
TimeSpan[] startTimes = Array.Empty<TimeSpan>();
int[] durations = Array.Empty<int>();
TimeSpan beginWorkingTime = new TimeSpan(9, 0, 0);
TimeSpan endWorkingTime = new TimeSpan(17, 0, 0);
int consultationTime = 30;
string[] result = calculations.AvailablePeriods(startTimes, durations, beginWorkingTime, endWorkingTime,
consultationTime);
Assert.AreEqual(16, result.Length);
Assert.AreEqual("09:00-09:30", result[0]);
Assert.AreEqual("16:30-17:00", result[15]);
}
[Test]
public void TestSingleBusyPeriod()
{
Calculations calculations = new Calculations();
TimeSpan[] startTimes = new TimeSpan[] { new TimeSpan(10, 0, 0) };
int[] durations = new int[] { 60 };
TimeSpan beginWorkingTime = new TimeSpan(9, 0, 0);
TimeSpan endWorkingTime = new TimeSpan(17, 0, 0);
int consultationTime = 30;
string[] result = calculations.AvailablePeriods(startTimes, durations, beginWorkingTime, endWorkingTime,
consultationTime);
Assert.AreEqual(14, result.Length);
Assert.AreEqual("09:00-09:30", result[0]);
Assert.AreEqual("09:30-10:00", result[1]);
Assert.AreEqual("11:00-11:30", result[2]);
Assert.AreEqual("16:30-17:00", result[13]);
}
[Test]
public void TestMultipleBusyPeriods()
{
// Arrange
Calculations calculations = new Calculations();
TimeSpan[] startTimes = new TimeSpan[]
{ new TimeSpan(10, 0, 0), new TimeSpan(12, 0, 0), new TimeSpan(14, 0, 0) };
int[] durations = new int[] { 60, 30, 90 };
TimeSpan beginWorkingTime = new TimeSpan(9, 0, 0);
TimeSpan endWorkingTime = new TimeSpan(17, 0, 0);
int consultationTime = 30;
// Act
string[] result = calculations.AvailablePeriods(startTimes, durations, beginWorkingTime, endWorkingTime,
consultationTime);
// Assert
Assert.AreEqual(10, result.Length);
Assert.AreEqual("09:00-09:30", result[0]);
Assert.AreEqual("09:30-10:00", result[1]);
Assert.AreEqual("11:00-11:30", result[2]);
Assert.AreEqual("11:30-12:00", result[3]);
Assert.AreEqual("12:30-13:00", result[4]);
Assert.AreEqual("15:30-16:00", result[5]);
Assert.AreEqual("16:00-16:30", result[6]);
Assert.AreEqual("16:30-17:00", result[7]);
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]

View File

@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Testiks")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8708167f350f0cee2641552a4606b22fce6f3410")]
[assembly: System.Reflection.AssemblyProductAttribute("Testiks")]
[assembly: System.Reflection.AssemblyTitleAttribute("Testiks")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Создано классом WriteCodeFragment MSBuild.

View File

@ -0,0 +1 @@
e69af12bf1b135ffcf04ff481e808e02b18433fc48dfb9688ea9c28413f1c9f4

View File

@ -0,0 +1,15 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Testiks
build_property.ProjectDir = C:\Users\prdb\RiderProjects\Demochka\demo_hard\Testiks\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =

View File

@ -0,0 +1,9 @@
// <auto-generated/>
global using global::NUnit.Framework;
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

Binary file not shown.

View File

@ -0,0 +1,164 @@
{
"format": 1,
"restore": {
"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj": {}
},
"projects": {
"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj",
"projectName": "Libary",
"projectPath": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj",
"packagesPath": "C:\\Users\\prdb\\.nuget\\packages\\",
"outputPath": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\prdb\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.200"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.200/PortableRuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj",
"projectName": "Testiks",
"projectPath": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj",
"packagesPath": "C:\\Users\\prdb\\.nuget\\packages\\",
"outputPath": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\prdb\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {
"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj": {
"projectPath": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.200"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.NET.Test.Sdk": {
"target": "Package",
"version": "[17.8.0, )"
},
"NUnit": {
"target": "Package",
"version": "[3.14.0, )"
},
"NUnit.Analyzers": {
"target": "Package",
"version": "[3.9.0, )"
},
"NUnit3TestAdapter": {
"target": "Package",
"version": "[4.5.0, )"
},
"coverlet.collector": {
"target": "Package",
"version": "[6.0.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.200/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\prdb\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.2</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\prdb\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)nunit3testadapter\4.5.0\build\netcoreapp3.1\NUnit3TestAdapter.props" Condition="Exists('$(NuGetPackageRoot)nunit3testadapter\4.5.0\build\netcoreapp3.1\NUnit3TestAdapter.props')" />
<Import Project="$(NuGetPackageRoot)nunit\3.14.0\build\NUnit.props" Condition="Exists('$(NuGetPackageRoot)nunit\3.14.0\build\NUnit.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost\17.8.0\build\netcoreapp3.1\Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost\17.8.0\build\netcoreapp3.1\Microsoft.TestPlatform.TestHost.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgNUnit_Analyzers Condition=" '$(PkgNUnit_Analyzers)' == '' ">C:\Users\prdb\.nuget\packages\nunit.analyzers\3.9.0</PkgNUnit_Analyzers>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\17.8.0\build\netstandard2.0\Microsoft.CodeCoverage.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.8.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.targets')" />
<Import Project="$(NuGetPackageRoot)coverlet.collector\6.0.0\build\netstandard1.0\coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector\6.0.0\build\netstandard1.0\coverlet.collector.targets')" />
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
{
"version": 2,
"dgSpecHash": "PFIva0Oq1Q4=",
"success": true,
"projectFilePath": "C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj",
"expectedPackageFiles": [
"C:\\Users\\prdb\\.nuget\\packages\\coverlet.collector\\6.0.0\\coverlet.collector.6.0.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\microsoft.codecoverage\\17.8.0\\microsoft.codecoverage.17.8.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\microsoft.net.test.sdk\\17.8.0\\microsoft.net.test.sdk.17.8.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\microsoft.testplatform.objectmodel\\17.8.0\\microsoft.testplatform.objectmodel.17.8.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\microsoft.testplatform.testhost\\17.8.0\\microsoft.testplatform.testhost.17.8.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\netstandard.library\\2.0.0\\netstandard.library.2.0.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\newtonsoft.json\\13.0.1\\newtonsoft.json.13.0.1.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\nuget.frameworks\\6.5.0\\nuget.frameworks.6.5.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\nunit\\3.14.0\\nunit.3.14.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\nunit.analyzers\\3.9.0\\nunit.analyzers.3.9.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\nunit3testadapter\\4.5.0\\nunit3testadapter.4.5.0.nupkg.sha512",
"C:\\Users\\prdb\\.nuget\\packages\\system.reflection.metadata\\1.6.0\\system.reflection.metadata.1.6.0.nupkg.sha512"
],
"logs": []
}

View File

@ -0,0 +1 @@
"restore":{"projectUniqueName":"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj","projectName":"Testiks","projectPath":"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\Testiks.csproj","outputPath":"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Testiks\\obj\\","projectStyle":"PackageReference","fallbackFolders":["C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"],"originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj":{"projectPath":"C:\\Users\\prdb\\RiderProjects\\Demochka\\demo_hard\\Libary\\Libary.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.200"}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Microsoft.NET.Test.Sdk":{"target":"Package","version":"[17.8.0, )"},"NUnit":{"target":"Package","version":"[3.14.0, )"},"NUnit.Analyzers":{"target":"Package","version":"[3.9.0, )"},"NUnit3TestAdapter":{"target":"Package","version":"[4.5.0, )"},"coverlet.collector":{"target":"Package","version":"[6.0.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.200/PortableRuntimeIdentifierGraph.json"}}

View File

@ -0,0 +1 @@
17412571203182305

View File

@ -0,0 +1 @@
17412571203182305