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

Created Unassigned: GenericCollectionAssertions needs BeSameAs() [12499]

$
0
0
There are times when you want to test that some method returns the same array that was passed into it. For example:

[Test]
public void CombineNullFirstBufferReturnsSecond()
{
var second = new byte[] { 1 };
var b = ArrayExtensions.Combine(null, second);
b.Should().BeSameAs(second); // this won't compile
}

Please consider adding this method, and perhaps related to any reference type, but in this case at least for arrays.

Commented Unassigned: GenericCollectionAssertions needs BeSameAs() [12499]

$
0
0
There are times when you want to test that some method returns the same array that was passed into it. For example:

[Test]
public void CombineNullFirstBufferReturnsSecond()
{
var second = new byte[] { 1 };
var b = ArrayExtensions.Combine(null, second);
b.Should().BeSameAs(second); // this won't compile
}

Please consider adding this method, and perhaps related to any reference type, but in this case at least for arrays.
Comments: I'm using this workaround for now: ((object)b).Should().BeSameAs(second);
Viewing all 1402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>