public void OneSiteIsNull() { MockSite site1 = new MockSite(); site1.Name = "z"; MockComponent c1 = new MockComponent(); c1.Site = site1; MockComponent c2 = new MockComponent(); object[] unsortedObjects = new object[] {c1, c2}; object[] expectedSortedObjects = new object[] {c2, c1}; Assert.AreEqual(expectedSortedObjects, PropertyPad.SortObjectsBySiteName(unsortedObjects)); }
public void SortedBySite() { MockSite site1 = new MockSite(); site1.Name = "b"; MockSite site2 = new MockSite(); site2.Name = "a"; MockSite site3 = new MockSite(); site3.Name = "z"; MockComponent c1 = new MockComponent(); c1.Site = site1; MockComponent c2 = new MockComponent(); c2.Site = site2; MockComponent c3 = new MockComponent(); c3.Site = site3; object[] unsortedObjects = new object[] {c1, c2, c3}; object[] expectedSortedObjects = new object[] {c2, c1, c3}; Assert.AreEqual(expectedSortedObjects, PropertyPad.SortObjectsBySiteName(unsortedObjects)); }