Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

Reopened Issue: set containing nulls and a call to"ShouldContainInOrder" throws NRE [12296]

$
0
0
gents,

because I'm an idiot, and I thought this would be a small task, I wrote my own quasi-CSV serializer. Now I'm testing it, and I've found an NRE in your nice framework:

I've got an IEnumerable<object> that looks like the following:
{{ {1, 2, 3, 4, "a string", 5, [null], 6, "another string"} }}
I'm doing
{{ thatIEnumerable.Should().ContainInOrder(anotherEnumerableThatsIdentical); }}
and I'm getting
Null Reference Exception
at FluentAssertions.Assertions.CollectionAssertions`2.<>c__DisplayClass5.<ContainInOrder>b__4(Object a) in c:\Workspaces\FluentAssertions\Releases\1.7.0\FluentAssertions.Net35\Assertions\CollectionAssertions.cs:line 673
at System.Linq.Enumerable.<SkipWhileIterator>d__52`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at FluentAssertions.Assertions.CollectionAssertions`2.ContainInOrder(IEnumerable expected, String reason, Object[] reasonArgs) in c:\Workspaces\FluentAssertions\Releases\1.7.0\FluentAssertions.Net35\Assertions\CollectionAssertions.cs:line 673
at FluentAssertions.Assertions.CollectionAssertions`2.ContainInOrder(IEnumerable expected) in c:\Workspaces\FluentAssertions\Releases\1.7.0\FluentAssertions.Net35\Assertions\CollectionAssertions.cs:line 637
at IQ.ProductLibrary.InitialPopulation.Tests.ProductCsvTranslatorFixture.when_reading_a_product_in_a_language_that_does_not_contain_all_entries_in_the_desired_language() in C:\Code\ProductLibrary\Clean\tests\InitialPopulation.Tests\ProductCsvTranslatorFixture.cs:line 132

--keep in mind that because that null is expected, a
{{
foreach(var expectedElement in anotherIEnumerableThatsIdentical)
{
... expectedElement.Equals(actualElement)
}}
will throw that NRE.

Viewing all articles
Browse latest Browse all 1402

Trending Articles