-
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
1 parent
38b4fa9
commit e1caa3b
Showing
7 changed files
with
161 additions
and
70 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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
Bor/DataStructureInterface.cs → Bor/Bor.Src/DataStructureInterface.cs
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,4 @@ | ||
namespace Data_Structure; | ||
namespace Data_Structures; | ||
|
||
interface IDataStructure | ||
{ | ||
|
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,56 @@ | ||
namespace Bor.Tests; | ||
using Data_Structures; | ||
|
||
public class Tests | ||
{ | ||
Bor trie; | ||
readonly string[] testStrings = ["abcdef", "abcdrfg", "abuq", "abcdeyunkhnrlnh", | ||
"slgbfb;gajga", "sldgaslgnlkg", "agdfjhahg"]; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
trie = new(); | ||
} | ||
|
||
[Test] | ||
public void Test1() | ||
{ | ||
foreach (string testString in testStrings) | ||
trie.Add(testString); | ||
|
||
foreach (var testString in testStrings) | ||
{ | ||
Assert.That(trie.Contains(testString)); | ||
} | ||
|
||
trie.Remove("abcdef"); | ||
|
||
foreach (var testString in testStrings) | ||
{ | ||
if (testString == "abcdef") | ||
{ | ||
Assert.That(!trie.Contains(testString)); | ||
} | ||
else | ||
{ | ||
Assert.That(trie.Contains(testString)); | ||
} | ||
} | ||
|
||
trie.Remove("abcdeyunkhnrlnh"); | ||
trie.Remove("slgbfb;gajga"); | ||
|
||
foreach (var testString in testStrings) | ||
{ | ||
if (testString == "abcdef" || testString == "abcdeyunkhnrlnh" || testString == "slgbfb;gajga") | ||
{ | ||
Assert.That(!trie.Contains(testString)); | ||
} | ||
else | ||
{ | ||
Assert.That(trie.Contains(testString)); | ||
} | ||
} | ||
} | ||
} |
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,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="..\Bor.Src\Bor.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,25 +1,28 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bor", "Bor.csproj", "{3E4A2A9D-6E00-4949-8262-52D4A299CD41}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3E4A2A9D-6E00-4949-8262-52D4A299CD41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3E4A2A9D-6E00-4949-8262-52D4A299CD41}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3E4A2A9D-6E00-4949-8262-52D4A299CD41}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3E4A2A9D-6E00-4949-8262-52D4A299CD41}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {24B336AF-AE4F-4566-96F6-B52F396BE150} | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.31903.59 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bor", "Bor.Src\Bor.csproj", "{349241AF-51B9-48AC-8F13-32D18AD15491}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bor.Tests", "Bor.Tests\Bor.Tests.csproj", "{9A666E6C-CA14-440A-BBFA-2A6066DEAC7F}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{349241AF-51B9-48AC-8F13-32D18AD15491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{349241AF-51B9-48AC-8F13-32D18AD15491}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{349241AF-51B9-48AC-8F13-32D18AD15491}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{349241AF-51B9-48AC-8F13-32D18AD15491}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{9A666E6C-CA14-440A-BBFA-2A6066DEAC7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9A666E6C-CA14-440A-BBFA-2A6066DEAC7F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{9A666E6C-CA14-440A-BBFA-2A6066DEAC7F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{9A666E6C-CA14-440A-BBFA-2A6066DEAC7F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |