using NUnit.Framework.Internal; using Quadarax.Foundation.Core.Value.Extensions; namespace qdr.fnd.core.test.Value { [TestFixture(Category = "Fnd.Core")] public class EnumExtTest : BaseTest { private enum TestEnum { One, Two, Three } private enum TestEnum2 { One2, Two2, Three2 } protected override void OnSetup() { } protected override void OnTearDown() { } [Test] public void InOK() { TestEnum value = TestEnum.Three; Assert.That(value.In(TestEnum.One), Is.False); Assert.That(value.In(TestEnum.One, TestEnum.Two), Is.False); Assert.That(value.In(TestEnum.One, TestEnum.Two, TestEnum.Three), Is.True); Assert.That(value.In(TestEnum.Three), Is.True); Assert.That(value.In("Three"), Is.False); Assert.That(value.In("TestEnum.Three"), Is.False); Assert.That(value.In("XX"), Is.False); } [Test] public void InFail() { TestEnum value = TestEnum.Three; // empty tenant code Assert.That(Assert.Throws(() => value.In(null))?.ParamName, Is.EqualTo("values")); } } }