public void Explore() { var twoThreeFour = new DomainOfValues <int>(2, 3, 4); twoThreeFour = new DomainOfValues <int>(twoThreeFour); DomainOfValues <string> aToc = DomainOf.Values("a", "b", "c"); Assert.That(twoThreeFour.CheckContains(2), Is.True); Assert.That(aToc.CheckContains("d"), Is.False); Assert.That(aToc.CheckContains("C"), Is.False); Assert.That(aToc.CheckContains("C", StringComparer.OrdinalIgnoreCase), Is.True); Assert.That(() => twoThreeFour.CheckContains(2), Throws.Nothing); Assert.That(() => aToc.AssertContains("d"), Throws.InstanceOf <InvalidDomainException <string> >()); Assert.That(() => aToc.AssertContains("C", StringComparer.OrdinalIgnoreCase), Throws.Nothing); }
public void TypeInferenceHelper_EmptyEnumerable_BuildsEmptyWrapper() { DomainOfValues <int> twoThreeFour = DomainOf.Values(new int[0]); Assert.That(twoThreeFour, Is.Empty); }
public void TypeInferenceHelper_Enumerable_BuildsEnumerableWrapper() { DomainOfValues <int> twoThreeFour = DomainOf.Values(new[] { 2, 3, 4 }); Assert.That(twoThreeFour, Is.EqualTo(new[] { 2, 3, 4 })); }
public void TypeInferenceHelper_EmptyParams_BuildsEmptyWrapper() { DomainOfValues <int> twoThreeFour = DomainOf.Values <int>(); Assert.That(twoThreeFour, Is.Empty); }
public void Ctor_NullEnumerable_BuildsEmptyWrapper() { var twoThreeFour = new DomainOfValues <int>(null); Assert.That(twoThreeFour, Is.Empty); }
public void Ctor_Enumerable_BuildsEnumerableWrapper() { var twoThreeFour = new DomainOfValues <int>(new[] { 2, 3, 4 }); Assert.That(twoThreeFour, Is.EqualTo(new[] { 2, 3, 4 })); }
public void Ctor_EmptyParams_BuildsEmptyWrapper() { var twoThreeFour = new DomainOfValues <int>(); Assert.That(twoThreeFour, Is.Empty); }