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

New Post: CollectionPropertyAssertions

$
0
0

Sorry, I didn't get you. I have created a simple example:

    public static class AssertionExtensions
    {
        public static CollectionAssertions<T> Should<T>(this IEnumerable<T> actual)
        {
            return new CollectionAssertions<T>(actual);
        }
    }

    public class CollectionAssertions<T>
    {
        private readonly IEnumerable<T> _actual;

        public CollectionAssertions(IEnumerable<T> actual)
        {
            _actual = actual;
        }

        public void Equal(IEnumerable<T> expected)
        {
            return;
        }
    }

    public class MainClass
    {
        public static void Main()
        {
            var actual = new List<int>() { 1, 2, 3 };
            actual.Should().Equal(new List<int>() { 1, 2, 3 });
        }
    }

I guess there is some difference between my code and FA code. But what is it?


Viewing all articles
Browse latest Browse all 1402

Trending Articles



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