public void TestOnWideSequence() { var seq = new List <Point>(); seq.Add(new Point(0, 0)); seq.Add(new Point(1, 1)); seq.Add(new Point(2, 2)); seq.Add(new Point(3, 3)); FrequencyFilter filter = new FrequencyFilter(); var filtered = filter.Filter(seq).ToArray(); Assert.IsTrue(filtered.Length == 4); }
public void TestOnNarrowSequence() { var seq = new List <Point>(); seq.Add(new Point(0, 0)); seq.Add(new Point(0.3, 0.3)); seq.Add(new Point(0.4, 0.5)); seq.Add(new Point(2, 2)); FrequencyFilter filter = new FrequencyFilter(); var filtered = filter.Filter(seq).ToArray(); Assert.IsTrue(filtered.Length == 2); }
public void TestFilteringLastPoint() { List <Point> unfiltered = new List <Point>(); unfiltered.Add(new Point(0, 0)); unfiltered.Add(new Point(1, 0.1)); unfiltered.Add(new Point(-1, 0.2)); unfiltered.Add(new Point(0.5, 0.22)); unfiltered.Add(new Point(0.4, 0.23)); unfiltered.Add(new Point(2, 0)); FrequencyFilter filter = new FrequencyFilter(); filter.SetScreenRect(new Rect(0, 0, 2, 10)); var filtered = filter.Filter(unfiltered); Assert.IsTrue(filtered[filtered.Count - 1] == new Point(2, 0)); }