Skip to content

Commit

Permalink
Add conditions to EquivalenceAssertsTests for XUNIT_IMMUTABLE_COLLECT…
Browse files Browse the repository at this point in the history
…IONS
  • Loading branch information
bradwilson committed Feb 2, 2024
1 parent cab6a3e commit 6bbf922
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test.xunit.assert/Asserts/EquivalenceAssertsTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using Xunit;
using Xunit.Sdk;

#if XUNIT_IMMUTABLE_COLLECTIONS
using System.Collections.Immutable;
#endif

public class EquivalenceAssertsTests
{
public class NullValues
Expand Down Expand Up @@ -654,6 +657,8 @@ public void Failure_EmbeddedArray_ExtraValueInActual()
}
}

#if XUNIT_IMMUTABLE_COLLECTIONS

public class ImmutableArrayOfValueTypes_NotStrict
{
[Fact]
Expand Down Expand Up @@ -783,6 +788,8 @@ public void Failure_EmbeddedArray_ExtraValueInActual()
}
}

#endif

public class ArrayOfObjects_NotStrict
{
[Fact]
Expand Down Expand Up @@ -1085,6 +1092,7 @@ public void ListIsEquivalentToArray()
Assert.Equivalent(new List<int> { 1, 2, 3 }, new[] { 1, 2, 3 });
}

#if XUNIT_IMMUTABLE_COLLECTIONS
[Fact]
public void ArrayIsEquivalentToImmutableArray()
{
Expand All @@ -1102,6 +1110,7 @@ public void ImmutableListIsEquivalentToImmutableSortedSet()
{
Assert.Equivalent(new[] { 1, 2, 3 }.ToImmutableList(), new[] { 1, 2, 3 }.ToImmutableSortedSet());
}
#endif
}

public class Dictionaries_NotStrict
Expand Down

0 comments on commit 6bbf922

Please sign in to comment.