Reformat / cleanup
All checks were successful
NuGet Publish / build-and-pack (push) Successful in 46s
NuGet Publish / publish-to-gitea (push) Successful in 56s

This commit is contained in:
Joseph Doherty
2026-02-21 08:10:36 -05:00
parent 4c6aaa5a3f
commit a70d8befae
176 changed files with 50555 additions and 49587 deletions

View File

@@ -1,48 +1,11 @@
using ZB.MOM.WW.CBDD.Bson;
using ZB.MOM.WW.CBDD.Core.Collections;
using Xunit;
using System.Linq;
namespace ZB.MOM.WW.CBDD.Tests;
public class VisibilityTests
{
public class VisibilityEntity
{
// Should be included
/// <summary>
/// Gets or sets the normal prop.
/// </summary>
public int NormalProp { get; set; }
// Should be included (serialization usually writes it)
/// <summary>
/// Gets or sets the private set prop.
/// </summary>
public int PrivateSetProp { get; private set; }
// Should be included
/// <summary>
/// Gets or sets the init prop.
/// </summary>
public int InitProp { get; init; }
// Fields - typically included in BSON if public, but reflection need GetFields
public string PublicField = string.Empty;
// Should NOT be included
private int _privateField;
// Helper to set private
/// <summary>
/// Tests set private.
/// </summary>
/// <param name="val">Value assigned to the private field.</param>
public void SetPrivate(int val) => _privateField = val;
}
/// <summary>
/// Tests generate schema visibility checks.
/// Tests generate schema visibility checks.
/// </summary>
[Fact]
public void GenerateSchema_VisibilityChecks()
@@ -60,4 +23,41 @@ public class VisibilityTests
schema.Fields.ShouldNotContain(f => f.Name == "_privatefield");
}
}
public class VisibilityEntity
{
// Should NOT be included
private int _privateField;
// Fields - typically included in BSON if public, but reflection need GetFields
public string PublicField = string.Empty;
// Should be included
/// <summary>
/// Gets or sets the normal prop.
/// </summary>
public int NormalProp { get; set; }
// Should be included (serialization usually writes it)
/// <summary>
/// Gets or sets the private set prop.
/// </summary>
public int PrivateSetProp { get; private set; }
// Should be included
/// <summary>
/// Gets or sets the init prop.
/// </summary>
public int InitProp { get; init; }
// Helper to set private
/// <summary>
/// Tests set private.
/// </summary>
/// <param name="val">Value assigned to the private field.</param>
public void SetPrivate(int val)
{
_privateField = val;
}
}
}