public void ICoordinate_Compare_Filtered_MoreThan_Source_ThrowsException() { List <ICoordinate> filtered = new List <ICoordinate>(); filtered.Add(new Coordinate(0, 0)); filtered.Add(new Coordinate(1, 1)); List <ICoordinate> source = new List <ICoordinate>(); source.Add(new Coordinate(0, 0)); FilterAnalyser.Quantify <ICoordinate>(source, filtered); }
public void ICoordinate_Compare_Filter_Matches_Source_Objects_Match_Assert() { ICoordinate a = new Coordinate(0, 0); ICoordinate b = new Coordinate(1, 1); ICoordinate c = new Coordinate(2, 2); ICoordinate d = new Coordinate(3, 3); ICoordinate e = new Coordinate(4, 4); List <ICoordinate> filtered = new List <ICoordinate>(new ICoordinate[] { a, b, c, d, e }); List <ICoordinate> source = new List <ICoordinate>(new ICoordinate[] { a, b, c, d, e }); IEnumerable <FilteredCoordinate <ICoordinate> > result = FilterAnalyser.Quantify <ICoordinate>(source, filtered); Assert.IsTrue(object.ReferenceEquals(a, result.ElementAt(0).Coordinate)); Assert.IsTrue(object.ReferenceEquals(b, result.ElementAt(1).Coordinate)); Assert.IsTrue(object.ReferenceEquals(c, result.ElementAt(2).Coordinate)); Assert.IsTrue(object.ReferenceEquals(d, result.ElementAt(3).Coordinate)); Assert.IsTrue(object.ReferenceEquals(e, result.ElementAt(4).Coordinate)); }
public void ICoordinate_Compare_Filter_Matches_Source_All_Included_Assert() { ICoordinate a = new Coordinate(0, 0); ICoordinate b = new Coordinate(1, 1); ICoordinate c = new Coordinate(2, 2); ICoordinate d = new Coordinate(3, 3); ICoordinate e = new Coordinate(4, 4); List <ICoordinate> filtered = new List <ICoordinate>(new ICoordinate[] { a, b, c, d, e }); List <ICoordinate> source = new List <ICoordinate>(new ICoordinate[] { a, b, c, d, e }); IEnumerable <FilteredCoordinate <ICoordinate> > result = FilterAnalyser.Quantify <ICoordinate>(source, filtered); Assert.AreEqual(FilteredCoordinateState.Included, result.ElementAt(0).State); Assert.AreEqual(FilteredCoordinateState.Included, result.ElementAt(1).State); Assert.AreEqual(FilteredCoordinateState.Included, result.ElementAt(2).State); Assert.AreEqual(FilteredCoordinateState.Included, result.ElementAt(3).State); Assert.AreEqual(FilteredCoordinateState.Included, result.ElementAt(4).State); }
public void ICoordinate_Compare_Source_Null_ThrowsException() { List <ICoordinate> filtered = new List <ICoordinate>(); FilterAnalyser.Quantify <ICoordinate>(filtered, null); }
public void ICoordinate_Compare_Filtered_Null_ThrowsException() { List <ICoordinate> source = new List <ICoordinate>(); FilterAnalyser.Quantify <ICoordinate>(null, source); }