using NUnit.Framework;
using Speckle.Sdk.Host;
using Speckle.Sdk.Models;
using Speckle.Sdk.Models.Extensions;
namespace Speckle.Sdk.Tests.Unit.Models.Extensions;
[TestOf(typeof(BaseExtensions))]
public class DisplayValueTests
{
private const string PAYLOAD = "This is my payload";
private static readonly Base s_displayValue = new() { applicationId = PAYLOAD };
static DisplayValueTests()
{
Reset();
}
private static void Reset()
{
TypeLoader.Reset();
TypeLoader.Initialize(typeof(Base).Assembly);
}
[SetUp]
public void Setup() => Reset();
[TestCaseSource(nameof(TestCases))]
public void TestTryGetDisplayValue_WithValue(Base testCase)
{
var res = testCase.TryGetDisplayValue();
Assert.That(res, Has.Count.EqualTo(1));
Assert.That(res, Has.One.Items.TypeOf().With.Property(nameof(Base.applicationId)).EqualTo(PAYLOAD));
}
public static IEnumerable TestCases()
{
var listOfBase = new List