Ejemplo n.º 1
0
 public void ReverseEdges_Throws()
 {
     // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
     // ReSharper disable once AssignNullToNotNullAttribute
     Assert.Throws <ArgumentNullException>(
         () => EdgeExtensions.ReverseEdges <int, Edge <int> >(null));
 }
Ejemplo n.º 2
0
        public void ReverseEdges()
        {
            CollectionAssert.IsEmpty(EdgeExtensions.ReverseEdges <int, Edge <int> >(Enumerable.Empty <Edge <int> >()));

            var edge1 = new Edge <int>(1, 2);

            CollectionAssert.AreEqual(
                new[] { new SReversedEdge <int, Edge <int> >(edge1) },
                EdgeExtensions.ReverseEdges <int, Edge <int> >(new[] { edge1 }));

            var edge2 = new Edge <int>(2, 2);
            var edge3 = new Edge <int>(3, 1);

            CollectionAssert.AreEqual(
                new[]
            {
                new SReversedEdge <int, Edge <int> >(edge1),
                new SReversedEdge <int, Edge <int> >(edge2),
                new SReversedEdge <int, Edge <int> >(edge3)
            },
                EdgeExtensions.ReverseEdges <int, Edge <int> >(new[] { edge1, edge2, edge3 }));
        }