bafd130ece
* 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
49 lines
1.0 KiB
C#
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);
|
|
}
|
|
}
|