public void ShouldCorrectlyReportCollectionSequenceEquality()
    {
        var s = Substitute.For <IXyz>();

        s.Do(new List <int> {
            1, 2, 3
        });
        s.Do(new List <string> {
            "a", "b", "c"
        });
        s.Received(1).Do(XArg.SequenceEqualTo(new List <int> {
            1, 2, 3
        }));
        s.Received(1).Do(XArg.SequenceEqualTo(new List <string> {
            "a", "b", "c"
        }));
        s.Invoking(m => m.Received(1).Do(XArg.SequenceEqualTo(new List <string> {
            "b", "c", "a"
        })))
        .Should().Throw <Exception>();
        s.Invoking(m => m.Received(1).Do(XArg.SequenceEqualTo(new List <int> {
            3, 2, 1
        })))
        .Should().Throw <Exception>();
    }
Exemplo n.º 2
0
        public void ShouldCorrectlyReportCollectionSequenceEquality()
        {
            var s = Substitute.For <IXyz>();

            s.Do(new List <int>()
            {
                1, 2, 3
            });
            s.Do(new List <string>()
            {
                "a", "b", "c"
            });
            s.Received(1).Do(XArg.SequenceEqualTo(new List <int>()
            {
                1, 2, 3
            }));
            s.Received(1).Do(XArg.SequenceEqualTo(new List <string>()
            {
                "a", "b", "c"
            }));
        }