Skip to content

Commit

Permalink
Automatically generated XML-comment stubs are added.
Browse files Browse the repository at this point in the history
  • Loading branch information
FreePhoenix888 committed Aug 22, 2021
1 parent f302482 commit ddc79bd
Show file tree
Hide file tree
Showing 73 changed files with 7,226 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,56 @@

namespace Platform.Data.Doublets.Sequences.Tests
{
/// <summary>
/// <para>
/// Represents the big integer converters tests.
/// </para>
/// <para></para>
/// </summary>
public class BigIntegerConvertersTests
{
/// <summary>
/// <para>
/// Creates the links.
/// </para>
/// <para></para>
/// </summary>
/// <returns>
/// <para>A links of t link</para>
/// <para></para>
/// </returns>
public ILinks<TLink> CreateLinks() => CreateLinks<TLink>(new IO.TemporaryFile());

/// <summary>
/// <para>
/// Creates the links using the specified data db filename.
/// </para>
/// <para></para>
/// </summary>
/// <typeparam name="TLink">
/// <para>The link.</para>
/// <para></para>
/// </typeparam>
/// <param name="dataDbFilename">
/// <para>The data db filename.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>A links of t link</para>
/// <para></para>
/// </returns>
public ILinks<TLink> CreateLinks<TLink>(string dataDbFilename)
{
var linksConstants = new LinksConstants<TLink>(enableExternalReferencesSupport: true);
return new UnitedMemoryLinks<TLink>(new FileMappedResizableDirectMemory(dataDbFilename), UnitedMemoryLinks<TLink>.DefaultLinksSizeStep, linksConstants, IndexTreeType.Default);
}

/// <summary>
/// <para>
/// Tests that decimal max value test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void DecimalMaxValueTest()
{
Expand All @@ -37,6 +77,12 @@ public void DecimalMaxValueTest()
Assert.Equal(bigInteger, bigIntFromSequence);
}

/// <summary>
/// <para>
/// Tests that decimal min value test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void DecimalMinValueTest()
{
Expand All @@ -53,6 +99,12 @@ public void DecimalMinValueTest()
Assert.Equal(bigInteger, bigIntFromSequence);
}

/// <summary>
/// <para>
/// Tests that zero value test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void ZeroValueTest()
{
Expand All @@ -69,6 +121,12 @@ public void ZeroValueTest()
Assert.Equal(bigInteger, bigIntFromSequence);
}

/// <summary>
/// <para>
/// Tests that one value test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void OneValueTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,138 @@

namespace Platform.Data.Doublets.Sequences.Tests
{
/// <summary>
/// <para>
/// Represents the default sequence appender tests.
/// </para>
/// <para></para>
/// </summary>
public class DefaultSequenceAppenderTests
{
/// <summary>
/// <para>
/// The output.
/// </para>
/// <para></para>
/// </summary>
private readonly ITestOutputHelper _output;

/// <summary>
/// <para>
/// Initializes a new <see cref="DefaultSequenceAppenderTests"/> instance.
/// </para>
/// <para></para>
/// </summary>
/// <param name="output">
/// <para>A output.</para>
/// <para></para>
/// </param>
public DefaultSequenceAppenderTests(ITestOutputHelper output)
{
_output = output;
}
/// <summary>
/// <para>
/// Creates the links.
/// </para>
/// <para></para>
/// </summary>
/// <returns>
/// <para>A links of t link</para>
/// <para></para>
/// </returns>
public static ILinks<TLink> CreateLinks() => CreateLinks<TLink>(new IO.TemporaryFile());

/// <summary>
/// <para>
/// Creates the links using the specified data db filename.
/// </para>
/// <para></para>
/// </summary>
/// <typeparam name="TLink">
/// <para>The link.</para>
/// <para></para>
/// </typeparam>
/// <param name="dataDBFilename">
/// <para>The data db filename.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>A links of t link</para>
/// <para></para>
/// </returns>
public static ILinks<TLink> CreateLinks<TLink>(string dataDBFilename)
{
var linksConstants = new LinksConstants<TLink>(enableExternalReferencesSupport: true);
return new UnitedMemoryLinks<TLink>(new FileMappedResizableDirectMemory(dataDBFilename), UnitedMemoryLinks<TLink>.DefaultLinksSizeStep, linksConstants, IndexTreeType.Default);
}

/// <summary>
/// <para>
/// Represents the value criterion matcher.
/// </para>
/// <para></para>
/// </summary>
/// <seealso cref="ICriterionMatcher{TLink}"/>
public class ValueCriterionMatcher<TLink> : ICriterionMatcher<TLink>
{
/// <summary>
/// <para>
/// The links.
/// </para>
/// <para></para>
/// </summary>
public readonly ILinks<TLink> Links;
/// <summary>
/// <para>
/// The marker.
/// </para>
/// <para></para>
/// </summary>
public readonly TLink Marker;
/// <summary>
/// <para>
/// Initializes a new <see cref="ValueCriterionMatcher"/> instance.
/// </para>
/// <para></para>
/// </summary>
/// <param name="links">
/// <para>A links.</para>
/// <para></para>
/// </param>
/// <param name="marker">
/// <para>A marker.</para>
/// <para></para>
/// </param>
public ValueCriterionMatcher(ILinks<TLink> links, TLink marker)
{
Links = links;
Marker = marker;
}

/// <summary>
/// <para>
/// Determines whether this instance is matched.
/// </para>
/// <para></para>
/// </summary>
/// <param name="link">
/// <para>The link.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>The bool</para>
/// <para></para>
/// </returns>
public bool IsMatched(TLink link) => EqualityComparer<TLink>.Default.Equals(Links.GetSource(link), Marker);
}

/// <summary>
/// <para>
/// Tests that append array bug.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void AppendArrayBug()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
using Xunit;
using Xunit;

namespace Platform.Data.Doublets.Sequences.Tests
{
/// <summary>
/// <para>
/// Represents the links extensions tests.
/// </para>
/// <para></para>
/// </summary>
public class ILinksExtensionsTests
{
/// <summary>
/// <para>
/// Tests that format test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void FormatTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,27 @@

namespace Platform.Data.Doublets.Sequences.Tests
{
/// <summary>
/// <para>
/// Represents the optimal variant sequence tests.
/// </para>
/// <para></para>
/// </summary>
public static class OptimalVariantSequenceTests
{
/// <summary>
/// <para>
/// The sequence example.
/// </para>
/// <para></para>
/// </summary>
private static readonly string _sequenceExample = "зеленела зелёная зелень";
/// <summary>
/// <para>
/// The lorem ipsum example.
/// </para>
/// <para></para>
/// </summary>
private static readonly string _loremIpsumExample = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Facilisi nullam vehicula ipsum a arcu cursus vitae congue mauris.
Et malesuada fames ac turpis egestas sed.
Expand Down Expand Up @@ -75,6 +93,12 @@ Eget lorem dolor sed viverra ipsum nunc.
Leo a diam sollicitudin tempor id eu.
Interdum consectetur libero id faucibus nisl tincidunt eget nullam non.";

/// <summary>
/// <para>
/// Tests that links based frequency stored optimal variant sequence test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public static void LinksBasedFrequencyStoredOptimalVariantSequenceTest()
{
Expand Down Expand Up @@ -107,6 +131,12 @@ public static void LinksBasedFrequencyStoredOptimalVariantSequenceTest()
}
}

/// <summary>
/// <para>
/// Tests that dictionary based frequency stored optimal variant sequence test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public static void DictionaryBasedFrequencyStoredOptimalVariantSequenceTest()
{
Expand Down Expand Up @@ -134,6 +164,32 @@ public static void DictionaryBasedFrequencyStoredOptimalVariantSequenceTest()
}
}

/// <summary>
/// <para>
/// Executes the test using the specified sequences.
/// </para>
/// <para></para>
/// </summary>
/// <param name="sequences">
/// <para>The sequences.</para>
/// <para></para>
/// </param>
/// <param name="sequence">
/// <para>The sequence.</para>
/// <para></para>
/// </param>
/// <param name="sequenceToItsLocalElementLevelsConverter">
/// <para>The sequence to its local element levels converter.</para>
/// <para></para>
/// </param>
/// <param name="index">
/// <para>The index.</para>
/// <para></para>
/// </param>
/// <param name="optimalVariantConverter">
/// <para>The optimal variant converter.</para>
/// <para></para>
/// </param>
private static void ExecuteTest(Sequences sequences, ulong[] sequence, SequenceToItsLocalElementLevelsConverter<ulong> sequenceToItsLocalElementLevelsConverter, ISequenceIndex<ulong> index, OptimalVariantConverter<ulong> optimalVariantConverter)
{
index.Add(sequence);
Expand All @@ -145,6 +201,12 @@ private static void ExecuteTest(Sequences sequences, ulong[] sequence, SequenceT
Assert.True(sequence.SequenceEqual(readSequence1));
}

/// <summary>
/// <para>
/// Tests that saved sequences optimization test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public static void SavedSequencesOptimizationTest()
{
Expand Down
Loading

0 comments on commit ddc79bd

Please sign in to comment.