Add XML documentation across gateway, worker, and .NET client
This commit is contained in:
@@ -11,6 +11,10 @@ public sealed class VariantConverterTests
|
||||
{
|
||||
private readonly VariantConverter _converter = new();
|
||||
|
||||
/// <summary>Verifies that supported scalar types are converted with correct data type and value kind.</summary>
|
||||
/// <param name="value">Scalar value to convert.</param>
|
||||
/// <param name="expectedDataType">Expected MxDataType of the converted value.</param>
|
||||
/// <param name="expectedKind">Expected KindOneofCase of the converted value.</param>
|
||||
[Theory]
|
||||
[InlineData(true, MxDataType.Boolean, MxValue.KindOneofCase.BoolValue)]
|
||||
[InlineData(42, MxDataType.Integer, MxValue.KindOneofCase.Int32Value)]
|
||||
@@ -30,6 +34,7 @@ public sealed class VariantConverterTests
|
||||
Assert.False(string.IsNullOrWhiteSpace(converted.VariantType));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that DateTime values are converted to protobuf timestamps.</summary>
|
||||
[Fact]
|
||||
public void Convert_WithDateTime_ProjectsTimestamp()
|
||||
{
|
||||
@@ -42,6 +47,7 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal("VT_DATE", converted.VariantType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that file time values with expected time data type are converted to protobuf timestamps.</summary>
|
||||
[Fact]
|
||||
public void Convert_WithFileTimeAndExpectedTime_ProjectsTimestamp()
|
||||
{
|
||||
@@ -54,6 +60,9 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal("VT_I8", converted.VariantType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that null-like values preserve their null semantics and variant type.</summary>
|
||||
/// <param name="value">Null-like value to convert.</param>
|
||||
/// <param name="expectedVariantType">Expected variant type string.</param>
|
||||
[Theory]
|
||||
[InlineData(null, "VT_EMPTY")]
|
||||
[InlineData(typeof(DBNull), "VT_NULL")]
|
||||
@@ -71,6 +80,7 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal(MxValue.KindOneofCase.None, converted.KindCase);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that supported array types are converted with correct element type and dimensions.</summary>
|
||||
[Fact]
|
||||
public void ConvertArray_WithSupportedArrays_ProjectsTypedValuesAndDimensions()
|
||||
{
|
||||
@@ -95,6 +105,7 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal(MxDataType.Boolean, bools.ArrayValue.ElementDataType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that multidimensional arrays preserve rank and dimension information.</summary>
|
||||
[Fact]
|
||||
public void ConvertArray_WithMultidimensionalArray_PreservesRankAndDimensions()
|
||||
{
|
||||
@@ -110,6 +121,7 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal(new[] { 1, 2, 3, 4, 5, 6 }, converted.ArrayValue.Int32Values.Values);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that file time arrays with expected time data type are converted to timestamp arrays.</summary>
|
||||
[Fact]
|
||||
public void ConvertArray_WithExpectedTimeAndFileTimeValues_ProjectsTimestampArray()
|
||||
{
|
||||
@@ -126,6 +138,7 @@ public sealed class VariantConverterTests
|
||||
converted.ArrayValue.TimestampValues.Values);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that unknown scalar types preserve raw value and diagnostic metadata.</summary>
|
||||
[Fact]
|
||||
public void Convert_WithUnknownScalar_PreservesRawMetadata()
|
||||
{
|
||||
@@ -140,6 +153,7 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal(ByteString.CopyFromUtf8("opaque"), converted.RawValue);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that unknown array types preserve raw values and diagnostic metadata.</summary>
|
||||
[Fact]
|
||||
public void ConvertArray_WithUnknownArray_PreservesRawMetadata()
|
||||
{
|
||||
@@ -158,6 +172,7 @@ public sealed class VariantConverterTests
|
||||
Assert.Contains(typeof(UnsupportedVariant).FullName!, converted.ArrayValue.RawDiagnostic);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that credential-bearing fields are redacted before logging.</summary>
|
||||
[Fact]
|
||||
public void Redactor_WithCredentialBearingValueFields_RedactsBeforeLogging()
|
||||
{
|
||||
@@ -166,15 +181,19 @@ public sealed class VariantConverterTests
|
||||
Assert.Equal(WorkerLogRedactor.RedactedValue, WorkerLogRedactor.RedactValue("secured_write_token", "secret"));
|
||||
}
|
||||
|
||||
/// <summary>Fake unsupported variant type for testing unknown type handling.</summary>
|
||||
private sealed class UnsupportedVariant
|
||||
{
|
||||
private readonly string _value;
|
||||
|
||||
/// <summary>Initializes a new instance of the UnsupportedVariant class.</summary>
|
||||
/// <param name="value">The opaque value.</param>
|
||||
public UnsupportedVariant(string value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return _value;
|
||||
|
||||
Reference in New Issue
Block a user