コード例 #1
0
        public void ShouldMatchDataIn_OperatingOnCollectionsOfSameLengthAndSameDataDifferentOrder_ShouldNotThrow()
        {
            //---------------Set up test pack-------------------
            var left  = new[] { IntWrapper.For(1), IntWrapper.For(2) };
            var right = new[] { IntWrapper.For(2), IntWrapper.For(1) };

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            Assert.DoesNotThrow(() => left.ShouldMatchDataIn(right));
            Assert.DoesNotThrow(() => right.ShouldMatchDataIn(left));

            //---------------Test Result -----------------------
        }
コード例 #2
0
        public void ShouldMatchDataInAndOrderOf_OperatingOnCollection_WhenComparisonCollectionIsDifferentSize_ShouldThrow()
        {
            //---------------Set up test pack-------------------
            var left  = new[] { IntWrapper.For(1), IntWrapper.For(2) };
            var right = new[] { IntWrapper.For(1) };

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            Assert.Throws <AssertionException>(() => left.ShouldMatchDataInAndOrderOf(right));
            Assert.Throws <AssertionException>(() => right.ShouldMatchDataInAndOrderOf(left));

            //---------------Test Result -----------------------
        }
コード例 #3
0
        public void ShouldMatchDataIn_OperatingOnCollectionsOfSameLengthButDifferentData_ShouldThrow()
        {
            //---------------Set up test pack-------------------
            var left  = new[] { IntWrapper.For(2) };
            var right = new[] { IntWrapper.For(1) };

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            Assert.Throws <AssertionException>(() => left.ShouldMatchDataIn(right));
            Assert.Throws <AssertionException>(() => right.ShouldMatchDataIn(left));

            //---------------Test Result -----------------------
        }