Files
speckle-sharp-sdk/tests/Speckle.Sdk.Serialization.Tests/SerializationTypeTests.cs
T
Adam Hathcock 375f5071ae Improve test coverage by adding tests and removing unused code (#240)
* maybe all objects need to be false

* fmt

* remove extra code form hosts

* fix build

* add speckle serializer exception test

* add DownloadObjects and DownloadSingleObject test

* fmt

* add HasObjects test

* BaseItem tests

* adjust code and add test for UploadObjects

* Remove try/catch

* can't test compressed?  use lib to parse multipart

* remove unused verify snapshots
2025-03-06 13:20:11 +00:00

37 lines
987 B
C#

using FluentAssertions;
using Speckle.Sdk.Serialisation;
using Speckle.Sdk.Serialisation.V2.Send;
namespace Speckle.Sdk.Serialization.Tests;
public class SerializationTypeTests
{
[Fact]
public void Json()
{
var json = new Json("{}");
json.ToString().Should().Be("{}");
}
[Fact]
public void Id()
{
var id = new Id("id");
id.ToString().Should().Be("id");
id.Equals(new Id("id")).Should().BeTrue();
id.Equals(new Id("id2")).Should().BeFalse();
id.GetHashCode().Should().Be("id".GetHashCode());
}
[Fact]
public void BaseItem()
{
var id = new Id("id");
var json = new Json("{}");
var baseItem = new BaseItem(id, json, false, new Dictionary<Id, int>());
baseItem.Equals(new BaseItem(id, json, false, new Dictionary<Id, int>())).Should().BeTrue();
baseItem.Equals(new BaseItem(new Id("id2"), json, false, new Dictionary<Id, int>())).Should().BeFalse();
baseItem.GetHashCode().Should().Be(id.GetHashCode());
}
}