Files
Jedd Morgan 06ef3e67e2 chore(deps): Correctly pin versions that need to be pinned and bump those that don't (#461)
* Correctly pin versions that need to be pinned and bump those that don't

* .NET logging alignment

* Fix test project dependencies

* recommended verify settings

* don't ask me why it needs this to work
2026-04-15 15:37:43 +01:00

44 lines
1.2 KiB
C#

using AwesomeAssertions;
using Speckle.Objects.Geometry;
using Speckle.Objects.Geometry.Autocad;
using Speckle.Sdk.Host;
using Speckle.Sdk.Models;
using Point = Speckle.Objects.Geometry.Point;
namespace Speckle.Objects.Tests.Unit;
public class ObjectBaseValidityTests
{
[Fact]
public void TestThatTypeWithoutAttributeFails()
{
TypeLoader.Reset();
TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly);
}
[Fact]
public void InheritanceTest_Disallow()
{
var exception = Assert.Throws<InvalidOperationException>(() =>
{
TypeLoader.Reset();
TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly, typeof(Test).Assembly);
});
exception.Should().NotBeNull();
exception
.Message.Should()
.Be("Speckle.Objects.Tests.Unit.ObjectBaseValidityTests+Test inherits from Base has no SpeckleTypeAttribute");
}
[Fact]
public void InheritanceTest_Allow()
{
TypeLoader.Reset();
TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly);
var fullTypeString = TypeLoader.GetFullTypeString(typeof(AutocadPolycurve));
fullTypeString.Should().Be("Objects.Geometry.Polycurve:Objects.Geometry.Autocad.AutocadPolycurve");
}
public class Test : Polycurve;
}