using CommonCore.Base.Extensions; using CommonCore.Base.Structures; using NUnit.Framework; namespace Base.Tests.Extensions; public class NullableExtensionTests { [Test] public void TestNullableStructOfNullToMaybe() => Assert.AreEqual(Maybe.Empty(), ((int?)null).ToMaybe()); [Test] public void TestNullableStructOfValueToMaybe() => Assert.AreEqual(Maybe.Create(25), ((int?)25).ToMaybe()); [Test] public void TestNullableRefOfNullToMaybe() => Assert.AreEqual(Maybe.Empty(), ((object?)null).ToMaybe()); [Test] public void TestNullableRefOfValueToMaybe() => Assert.AreEqual(Maybe.Create(new {}), ((object?)new {}).ToMaybe()); }