public void add_2() { PerfSerie ps = new PerfSerie(); ps.add(new PerfPoint(3, 10, false)); ps.add(new PerfPoint(1, 5, true)); ps.add(new PerfPoint(-5, 1, false)); ps.add(new PerfPoint(-1, 15, false)); ps.add(new PerfPoint(8, 6, false)); Assert.AreEqual(-5, ps.pointAt(0).factorValue); Assert.AreEqual(-1, ps.pointAt(1).factorValue); Assert.AreEqual(1, ps.pointAt(2).factorValue); Assert.AreEqual(3, ps.pointAt(3).factorValue); Assert.AreEqual(8, ps.pointAt(4).factorValue); }
public void PerfSerie_1() { PerfSerie ps = new PerfSerie(); ps.add(new PerfPoint(3, 10, false)); ps.add(new PerfPoint(1, 5, true)); ps.add(new PerfPoint(-5, 1, false)); PerfSerie psClone = new PerfSerie(ps); Assert.AreEqual(3, psClone.count); for (int count = 0; count < ps.count; count++) { Assert.AreEqual(ps.pointAt(count).factorValue, psClone.pointAt(count).factorValue); } }
public void selectPoints_2() { PerfSerie ps = new PerfSerie(); ps.add(new PerfPoint(-12, 10, false)); ps.add(new PerfPoint(-9, 5, false)); ps.add(new PerfPoint(-8, 5, false)); ps.add(new PerfPoint(-5, -1, false)); ps.add(new PerfPoint(-1, -1, true)); ps.add(new PerfPoint(0, 1, false)); ps.add(new PerfPoint(1, 1, true)); ps.add(new PerfPoint(3, 0, true)); ps.add(new PerfPoint(7, 3, false)); Assert.IsTrue(ps._A_selectPoints(-1.5, 3)); Assert.IsFalse(ps.pointAt(0).selected); Assert.IsFalse(ps.pointAt(1).selected); Assert.IsTrue(ps.pointAt(2).selected); Assert.IsTrue(ps.pointAt(3).selected); Assert.IsTrue(ps.pointAt(4).selected); Assert.IsFalse(ps.pointAt(5).selected); Assert.IsFalse(ps.pointAt(6).selected); Assert.IsFalse(ps.pointAt(7).selected); Assert.IsFalse(ps.pointAt(8).selected); Assert.IsTrue(ps._A_selectPoints(2, 3)); Assert.IsFalse(ps.pointAt(0).selected); Assert.IsFalse(ps.pointAt(1).selected); Assert.IsFalse(ps.pointAt(2).selected); Assert.IsFalse(ps.pointAt(3).selected); Assert.IsFalse(ps.pointAt(4).selected); Assert.IsFalse(ps.pointAt(5).selected); Assert.IsTrue(ps.pointAt(6).selected); Assert.IsTrue(ps.pointAt(7).selected); Assert.IsFalse(ps.pointAt(8).selected); }