ccb4f54550
* Sdk * Objects * Supressed IDE warnings via editor config instead of nowarn * Nullability and other warnings * using * Required keyword on lines and meshes * Fixed test project * fixed tests * Proxies * Fixed equality of Point * IEquatable * Fixed issue with serialization of detached lists * Added tests for jsonIgnore affecting id calc * removed comments * Fixed issue with fallback to double on large values * Fixed undocumented large number support
49 lines
1004 B
C#
49 lines
1004 B
C#
using System.Collections;
|
|
using NUnit.Framework;
|
|
using Speckle.Objects.BuiltElements;
|
|
using Speckle.Objects.Geometry;
|
|
using Speckle.Sdk.Common;
|
|
|
|
namespace Speckle.Objects.Tests.Unit.Utils;
|
|
|
|
[TestFixture]
|
|
public class ShallowCopyTests
|
|
{
|
|
[Test]
|
|
public void CanShallowCopy_Wall()
|
|
{
|
|
const string UNITS = Units.Meters;
|
|
var wall = new Wall(
|
|
5,
|
|
new Line()
|
|
{
|
|
start = new Point(0, 0, 0, UNITS),
|
|
end = new Point(3, 0, 0, UNITS),
|
|
units = UNITS
|
|
}
|
|
)
|
|
{
|
|
units = UNITS,
|
|
displayValue = new List<Mesh>
|
|
{
|
|
new Mesh
|
|
{
|
|
vertices = new(),
|
|
faces = new(),
|
|
units = UNITS
|
|
},
|
|
new Mesh
|
|
{
|
|
vertices = new(),
|
|
faces = new(),
|
|
units = UNITS
|
|
},
|
|
}
|
|
};
|
|
|
|
var shallow = wall.ShallowCopy();
|
|
var displayValue = (IList)shallow["displayValue"].NotNull();
|
|
Assert.That(wall.displayValue, Has.Count.EqualTo(displayValue.Count));
|
|
}
|
|
}
|