Initialize CBDD solution and add a .NET-focused gitignore for generated artifacts.

This commit is contained in:
Joseph Doherty
2026-02-20 12:54:07 -05:00
commit b8ed5ec500
214 changed files with 101452 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
using ZB.MOM.WW.CBDD.Bson;
using ZB.MOM.WW.CBDD.Core;
using ZB.MOM.WW.CBDD.Core.Collections;
using ZB.MOM.WW.CBDD.Core.Metadata;
using ZB.MOM.WW.CBDD.Shared;
using Xunit;
namespace ZB.MOM.WW.CBDD.Tests;
public class ValueObjectIdTests : IDisposable
{
private readonly string _dbPath = "value_object_ids.db";
private readonly Shared.TestDbContext _db;
public ValueObjectIdTests()
{
if (File.Exists(_dbPath)) File.Delete(_dbPath);
_db = new Shared.TestDbContext(_dbPath);
}
[Fact]
public void Should_Support_ValueObject_Id_Conversion()
{
var order = new Order
{
Id = new OrderId("ORD-123"),
CustomerName = "John Doe"
};
_db.Orders.Insert(order);
var retrieved = _db.Orders.FindById(new OrderId("ORD-123"));
retrieved.ShouldNotBeNull();
retrieved.Id.Value.ShouldBe("ORD-123");
retrieved.CustomerName.ShouldBe("John Doe");
}
public void Dispose()
{
_db.Dispose();
if (File.Exists(_dbPath)) File.Delete(_dbPath);
}
}