Files
speckle-sharp-sdk/tests/Speckle.Objects.Tests.Unit/Utils/ShallowCopyTests.cs
T
Adam Hathcock bafd130ece Snapshot testing (#208)
* snapshot testing with verify

* formatting

* add back old serialization tests

* pass verify

* use json correctly

* formatting

* Don't use Quibble and order ourselves because ordering doesn't matter

* whitespace on snapshot

* Better json diffing?  Quibble is back

* add common project

* add object unit tests to see how verify would work

* format

* move random exes to new solution folder

* update lock files
2025-01-16 13:46:53 +00:00

49 lines
1.0 KiB
C#

using System.Collections;
using FluentAssertions;
using Speckle.Objects.Data;
using Speckle.Objects.Geometry;
using Speckle.Sdk.Common;
using Speckle.Sdk.Host;
using Speckle.Sdk.Models;
namespace Speckle.Objects.Tests.Unit.Utils;
public class ShallowCopyTests
{
public ShallowCopyTests()
{
TypeLoader.Reset();
TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly);
}
[Fact]
public void CanShallowCopy_Wall()
{
const string UNITS = Units.Meters;
var ds = new DataObject()
{
name = "directShape",
displayValue = new List<Base>
{
new Mesh
{
vertices = new(),
faces = new(),
units = UNITS,
},
new Mesh
{
vertices = new(),
faces = new(),
units = UNITS,
},
},
properties = new Dictionary<string, object?>(),
};
var shallow = ds.ShallowCopy();
var displayValue = (IList)shallow["displayValue"].NotNull();
ds.displayValue.Count.Should().Be(displayValue.Count);
}
}