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,25 +1,24 @@
using ZB.MOM.WW.CBDD.Bson;
using ZB.MOM.WW.CBDD.Core.Collections;
using ZB.MOM.WW.CBDD.Shared;
namespace ZB.MOM.WW.CBDD.Tests;
public class SetMethodTests : IDisposable
{
private readonly TestDbContext _db;
private readonly string _dbPath;
private readonly Shared.TestDbContext _db;
/// <summary>
/// Initializes a new instance of the <see cref="SetMethodTests"/> class.
/// Initializes a new instance of the <see cref="SetMethodTests" /> class.
/// </summary>
public SetMethodTests()
{
_dbPath = Path.Combine(Path.GetTempPath(), $"cbdd_set_{Guid.NewGuid()}.db");
_db = new Shared.TestDbContext(_dbPath);
_db = new TestDbContext(_dbPath);
}
/// <summary>
/// Disposes the resources used by this instance.
/// Disposes the resources used by this instance.
/// </summary>
public void Dispose()
{
@@ -28,7 +27,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set object id returns correct collection.
/// Tests set object id returns correct collection.
/// </summary>
[Fact]
public void Set_ObjectId_ReturnsCorrectCollection()
@@ -39,7 +38,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set shorthand returns correct collection.
/// Tests set shorthand returns correct collection.
/// </summary>
[Fact]
public void Set_Shorthand_ReturnsCorrectCollection()
@@ -50,7 +49,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set int returns correct collection.
/// Tests set int returns correct collection.
/// </summary>
[Fact]
public void Set_Int_ReturnsCorrectCollection()
@@ -61,7 +60,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set string returns correct collection.
/// Tests set string returns correct collection.
/// </summary>
[Fact]
public void Set_String_ReturnsCorrectCollection()
@@ -72,7 +71,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set guid returns correct collection.
/// Tests set guid returns correct collection.
/// </summary>
[Fact]
public void Set_Guid_ReturnsCorrectCollection()
@@ -83,7 +82,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set custom key returns correct collection.
/// Tests set custom key returns correct collection.
/// </summary>
[Fact]
public void Set_CustomKey_ReturnsCorrectCollection()
@@ -94,7 +93,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set all object id collections return correct instances.
/// Tests set all object id collections return correct instances.
/// </summary>
[Fact]
public void Set_AllObjectIdCollections_ReturnCorrectInstances()
@@ -110,7 +109,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set all int collections return correct instances.
/// Tests set all int collections return correct instances.
/// </summary>
[Fact]
public void Set_AllIntCollections_ReturnCorrectInstances()
@@ -123,7 +122,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set string key collections return correct instances.
/// Tests set string key collections return correct instances.
/// </summary>
[Fact]
public void Set_StringKeyCollections_ReturnCorrectInstances()
@@ -132,7 +131,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set unregistered entity throws invalid operation exception.
/// Tests set unregistered entity throws invalid operation exception.
/// </summary>
[Fact]
public void Set_UnregisteredEntity_ThrowsInvalidOperationException()
@@ -141,7 +140,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set wrong key type throws invalid operation exception.
/// Tests set wrong key type throws invalid operation exception.
/// </summary>
[Fact]
public void Set_WrongKeyType_ThrowsInvalidOperationException()
@@ -150,7 +149,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set can perform operations.
/// Tests set can perform operations.
/// </summary>
[Fact]
public void Set_CanPerformOperations()
@@ -167,7 +166,7 @@ public class SetMethodTests : IDisposable
}
/// <summary>
/// Tests set with int key can perform operations.
/// Tests set with int key can perform operations.
/// </summary>
[Fact]
public void Set_WithIntKey_CanPerformOperations()
@@ -186,20 +185,20 @@ public class SetMethodTests : IDisposable
public class SetMethodInheritanceTests : IDisposable
{
private readonly TestExtendedDbContext _db;
private readonly string _dbPath;
private readonly Shared.TestExtendedDbContext _db;
/// <summary>
/// Initializes a new instance of the <see cref="SetMethodInheritanceTests"/> class.
/// Initializes a new instance of the <see cref="SetMethodInheritanceTests" /> class.
/// </summary>
public SetMethodInheritanceTests()
{
_dbPath = Path.Combine(Path.GetTempPath(), $"cbdd_set_inherit_{Guid.NewGuid()}.db");
_db = new Shared.TestExtendedDbContext(_dbPath);
_db = new TestExtendedDbContext(_dbPath);
}
/// <summary>
/// Disposes the resources used by this instance.
/// Disposes the resources used by this instance.
/// </summary>
public void Dispose()
{
@@ -208,7 +207,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set own collection returns correct instance.
/// Tests set own collection returns correct instance.
/// </summary>
[Fact]
public void Set_OwnCollection_ReturnsCorrectInstance()
@@ -219,7 +218,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set parent collection returns correct instance.
/// Tests set parent collection returns correct instance.
/// </summary>
[Fact]
public void Set_ParentCollection_ReturnsCorrectInstance()
@@ -230,7 +229,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set parent shorthand returns correct instance.
/// Tests set parent shorthand returns correct instance.
/// </summary>
[Fact]
public void Set_ParentShorthand_ReturnsCorrectInstance()
@@ -241,7 +240,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set parent int collection returns correct instance.
/// Tests set parent int collection returns correct instance.
/// </summary>
[Fact]
public void Set_ParentIntCollection_ReturnsCorrectInstance()
@@ -251,7 +250,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set parent custom key returns correct instance.
/// Tests set parent custom key returns correct instance.
/// </summary>
[Fact]
public void Set_ParentCustomKey_ReturnsCorrectInstance()
@@ -262,7 +261,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set unregistered entity throws invalid operation exception.
/// Tests set unregistered entity throws invalid operation exception.
/// </summary>
[Fact]
public void Set_UnregisteredEntity_ThrowsInvalidOperationException()
@@ -271,7 +270,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set own collection can perform operations.
/// Tests set own collection can perform operations.
/// </summary>
[Fact]
public void Set_OwnCollection_CanPerformOperations()
@@ -287,7 +286,7 @@ public class SetMethodInheritanceTests : IDisposable
}
/// <summary>
/// Tests set parent collection can perform operations.
/// Tests set parent collection can perform operations.
/// </summary>
[Fact]
public void Set_ParentCollection_CanPerformOperations()
@@ -301,4 +300,4 @@ public class SetMethodInheritanceTests : IDisposable
found.ShouldNotBeNull();
found.Name.ShouldBe("Bob");
}
}
}