NUnit Assert a list of objects in no order
- by Shawn Mclean
How do I Assert a collection of items in no particular order? I just want to make sure all the items are in the list.
I'm heard of CollectionAssert but I do not see any method that would do what I want.
My object looks like this:
public class Vector2{
public float X {get; set;}
public float Y {get; set;}
}
Assert - I want something like this:
CollectionAssert.ContainsAll(mesh.GetPolygonVertices(0), aListOfVertices);
mesh.GetPolygonVertices(int) returns a List<Vector2> and aListOfVertices contains all of what is returned, but not guaranteed that order.