示例#1
0
        public void IfCollectionsAreNotEquivalent()
        {
            var kolekcja1 = new[] { "ala", "olo" };
            var kolekcja1InnaKolejność = new[] { "olo", "ala" };
            var kolekcja2 = new[] { "ala", "inna" };
            var pusta1    = new string[0];
            // ReSharper disable once CollectionNeverUpdated.Local
            var pusta2 = new List <string>();

            Assert.Throws <DesignByContractViolationException>(
                () => Fail.IfCollectionsAreNotEquivalent(kolekcja1, kolekcja2, "są różne")
                );

            Fail.IfCollectionsAreNotEquivalent(kolekcja1, kolekcja1InnaKolejność, "są różne");
            Fail.IfCollectionsAreNotEquivalent(pusta1, pusta2, "są różne");
        }
 public void IfCollectionsAreNotEquivalentSuccess([NotNull] Tuple <IEnumerable <object>, IEnumerable <object> > pair)
 {
     Fail.IfCollectionsAreNotEquivalent(pair.Item1, pair.Item2, Violation.Of("collections are different"));
 }
 public void IfCollectionsAreNotEquivalent([NotNull] Tuple <IEnumerable <object>, IEnumerable <object> > pair)
 {
     Assert.Throws <DesignByContractViolationException>(
         () => Fail.IfCollectionsAreNotEquivalent(pair.Item1, pair.Item2, Violation.Of("collections are different"))
         );
 }