14d959834f
* xunit unit tests * most pass with formatting * convert objects to xunit * remove nunit * format * merge fixes * switch objects to fluent assertions * update to fluent assertions * more FA * convert all to FA * Format * Fix tests * formatting * hopefully made credential test better * Catch more specific exception * use another more specific exception * Fix tests * update to xunit * update packages
50 lines
1.1 KiB
C#
50 lines
1.1 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;
|
|
using Xunit;
|
|
|
|
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);
|
|
}
|
|
}
|