Skip to content

Commit

Permalink
Replace Marker with Type in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Konard committed Jan 18, 2024
1 parent adcddfc commit f907016
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public TLinkAddress GetObjectWihoutLoop(TLinkAddress objectValue)

TLinkAddress current = objectValue;
TLinkAddress source = _links.GetSource(current);
if (equalityComparer.Equals(source, _defaultJsonStorage.ObjectMarker))
if (equalityComparer.Equals(source, _defaultJsonStorage.ObjectType))
{
return current;
}
current = _links.GetTarget(current);
source = _links.GetSource(current);
if (equalityComparer.Equals(source, _defaultJsonStorage.ObjectMarker))
if (equalityComparer.Equals(source, _defaultJsonStorage.ObjectType))
{
return current;
}
current = _links.GetTarget(current);
source = _links.GetSource(current);
if (equalityComparer.Equals(source, _defaultJsonStorage.ObjectMarker))
if (equalityComparer.Equals(source, _defaultJsonStorage.ObjectType))
{
return current;
}
Expand Down
68 changes: 34 additions & 34 deletions csharp/Platform.Data.Doublets.Json.Tests/JsonStorageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ public void AttachObjectValueToDocumentTest()
TLinkAddress documentValueLink = defaultJsonStorage.AttachObject(document);
TLinkAddress createdObjectValue = links.GetTarget(documentValueLink);

TLinkAddress valueMarker = links.GetSource(createdObjectValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdObjectValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress createdObject = links.GetTarget(createdObjectValue);
TLinkAddress objectMarker = links.GetSource(createdObject);
Assert.Equal(objectMarker, defaultJsonStorage.ObjectMarker);
TLinkAddress objectType = links.GetSource(createdObject);
Assert.Equal(objectType, defaultJsonStorage.ObjectType);

TLinkAddress foundDocumentValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdObjectValue, foundDocumentValue);
Expand All @@ -114,12 +114,12 @@ public void AttachStringValueToDocumentTest()
TLinkAddress documentStringLink = defaultJsonStorage.AttachString(document, "stringName");
TLinkAddress createdStringValue = links.GetTarget(documentStringLink);

TLinkAddress valueMarker = links.GetSource(createdStringValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdStringValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress createdString = links.GetTarget(createdStringValue);
TLinkAddress stringMarker = links.GetSource(createdString);
Assert.Equal(stringMarker, defaultJsonStorage.StringMarker);
TLinkAddress stringType = links.GetSource(createdString);
Assert.Equal(stringType, defaultJsonStorage.StringType);

TLinkAddress foundStringValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdStringValue, foundStringValue);
Expand All @@ -134,12 +134,12 @@ public void AttachNumberToDocumentTest()
TLinkAddress documentNumberLink = defaultJsonStorage.AttachNumber(document, 2021);
TLinkAddress createdNumberValue = links.GetTarget(documentNumberLink);

TLinkAddress valueMarker = links.GetSource(createdNumberValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdNumberValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress createdNumber = links.GetTarget(createdNumberValue);
TLinkAddress numberMarker = links.GetSource(createdNumber);
Assert.Equal(numberMarker, defaultJsonStorage.NumberMarker);
TLinkAddress numberType = links.GetSource(createdNumber);
Assert.Equal(numberType, defaultJsonStorage.NumberType);

TLinkAddress foundNumberValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdNumberValue, foundNumberValue);
Expand All @@ -155,11 +155,11 @@ public void AttachTrueValueToDocumentTest()
TLinkAddress documentTrueValueLink = defaultJsonStorage.AttachBoolean(document, true);
TLinkAddress createdTrueValue = links.GetTarget(documentTrueValueLink);

TLinkAddress valueMarker = links.GetSource(createdTrueValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdTrueValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress trueMarker = links.GetTarget(createdTrueValue);
Assert.Equal(trueMarker, defaultJsonStorage.TrueMarker);
TLinkAddress trueType = links.GetTarget(createdTrueValue);
Assert.Equal(trueType, defaultJsonStorage.TrueType);

TLinkAddress foundTrueValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdTrueValue, foundTrueValue);
Expand All @@ -175,11 +175,11 @@ public void AttachFalseValueToDocumentTest()
TLinkAddress documentFalseValueLink = defaultJsonStorage.AttachBoolean(document, false);
TLinkAddress createdFalseValue = links.GetTarget(documentFalseValueLink);

TLinkAddress valueMarker = links.GetSource(createdFalseValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdFalseValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress falseMarker = links.GetTarget(createdFalseValue);
Assert.Equal(falseMarker, defaultJsonStorage.FalseMarker);
TLinkAddress falseType = links.GetTarget(createdFalseValue);
Assert.Equal(falseType, defaultJsonStorage.FalseType);

TLinkAddress foundFalseValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdFalseValue, foundFalseValue);
Expand All @@ -195,11 +195,11 @@ public void AttachNullValueToDocumentTest()
TLinkAddress documentNullValueLink = defaultJsonStorage.AttachNull(document);
TLinkAddress createdNullValue = links.GetTarget(documentNullValueLink);

TLinkAddress valueMarker = links.GetSource(createdNullValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdNullValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress nullMarker = links.GetTarget(createdNullValue);
Assert.Equal(nullMarker, defaultJsonStorage.NullMarker);
TLinkAddress nullType = links.GetTarget(createdNullValue);
Assert.Equal(nullType, defaultJsonStorage.NullType);

TLinkAddress foundNullValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdNullValue, foundNullValue);
Expand All @@ -217,15 +217,15 @@ public void AttachEmptyArrayValueToDocumentTest()
output.WriteLine(links.Format(createdArrayValue));


TLinkAddress valueMarker = links.GetSource(createdArrayValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdArrayValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress createdArrayLink = links.GetTarget(createdArrayValue);
TLinkAddress arrayMarker = links.GetSource(createdArrayLink);
Assert.Equal(arrayMarker, defaultJsonStorage.ArrayMarker);
TLinkAddress arrayType = links.GetSource(createdArrayLink);
Assert.Equal(arrayType, defaultJsonStorage.ArrayType);

TLinkAddress createArrayContents = links.GetTarget(createdArrayLink);
Assert.Equal(createArrayContents, defaultJsonStorage.EmptyArrayMarker);
Assert.Equal(createArrayContents, defaultJsonStorage.EmptyArrayType);

TLinkAddress foundArrayValue = defaultJsonStorage.GetValueLink(document);
Assert.Equal(createdArrayValue, foundArrayValue);
Expand All @@ -246,19 +246,19 @@ public void AttachArrayValueToDocumentTest()
TLinkAddress createdArrayValue = links.GetTarget(documentArrayValueLink);

DefaultStack<TLinkAddress> stack = new();
RightSequenceWalker<TLinkAddress> rightSequenceWalker = new(links, stack, arrayElementLink => links.GetSource(arrayElementLink) == defaultJsonStorage.ValueMarker);
RightSequenceWalker<TLinkAddress> rightSequenceWalker = new(links, stack, arrayElementLink => links.GetSource(arrayElementLink) == defaultJsonStorage.ValueType);
IEnumerable<TLinkAddress> arrayElementsValuesLink = rightSequenceWalker.Walk(createdArrayValue);
Assert.NotEmpty(arrayElementsValuesLink);

output.WriteLine(links.Format(createdArrayValue));


TLinkAddress valueMarker = links.GetSource(createdArrayValue);
Assert.Equal(valueMarker, defaultJsonStorage.ValueMarker);
TLinkAddress valueType = links.GetSource(createdArrayValue);
Assert.Equal(valueType, defaultJsonStorage.ValueType);

TLinkAddress createdArrayLink = links.GetTarget(createdArrayValue);
TLinkAddress arrayMarker = links.GetSource(createdArrayLink);
Assert.Equal(arrayMarker, defaultJsonStorage.ArrayMarker);
TLinkAddress arrayType = links.GetSource(createdArrayLink);
Assert.Equal(arrayType, defaultJsonStorage.ArrayType);

TLinkAddress createdArrayContents = links.GetTarget(createdArrayLink);
Assert.Equal(links.GetTarget(createdArrayContents), arrayElement);
Expand Down
28 changes: 14 additions & 14 deletions csharp/Platform.Data.Doublets.Json/DefaultJsonStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,91 +167,91 @@ public class DefaultJsonStorage<TLinkAddress> : IJsonStorage<TLinkAddress>
public ILinks<TLinkAddress> Links { get; }
/// <summary>
/// <para>
/// Gets the document marker value.
/// Gets the document type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress DocumentType { get; }
/// <summary>
/// <para>
/// Gets the object marker value.
/// Gets the object type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress ObjectType { get; }
/// <summary>
/// <para>
/// Gets the member marker value.
/// Gets the member type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress MemberType { get; }
/// <summary>
/// <para>
/// Gets the value marker value.
/// Gets the value type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress ValueType { get; }
/// <summary>
/// <para>
/// Gets the string marker value.
/// Gets the string type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress StringType { get; }
/// <summary>
/// <para>
/// Gets the empty string marker value.
/// Gets the empty string type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress EmptyStringType { get; }
/// <summary>
/// <para>
/// Gets the number marker value.
/// Gets the number type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress NumberType { get; }
/// <summary>
/// <para>
/// Gets the negative number marker value.
/// Gets the negative number type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress NegativeNumberType { get; }
/// <summary>
/// <para>
/// Gets the array marker value.
/// Gets the array type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress ArrayType { get; }
/// <summary>
/// <para>
/// Gets the empty array marker value.
/// Gets the empty array type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress EmptyArrayType { get; }
/// <summary>
/// <para>
/// Gets the true marker value.
/// Gets the true type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress TrueType { get; }
/// <summary>
/// <para>
/// Gets the false marker value.
/// Gets the false type value.
/// </para>
/// <para></para>
/// </summary>
public TLinkAddress FalseType { get; }
/// <summary>
/// <para>
/// Gets the null marker value.
/// Gets the null type value.
/// </para>
/// <para></para>
/// </summary>
Expand Down Expand Up @@ -1040,7 +1040,7 @@ public TLinkAddress GetValueLink(TLinkAddress parent)

/// <summary>
/// <para>
/// Gets the value marker using the specified value.
/// Gets the value type using the specified value.
/// </para>
/// <para></para>
/// </summary>
Expand Down
Loading

0 comments on commit f907016

Please sign in to comment.