public void TimeLineTest() { TimeLine timeline = new TimeLine("Test"); TickMark tick = new TickMark("Test", 0); Assert.AreEqual(13, timeline.GetID()); Assert.AreEqual(Convert.ToDateTime("1/1/1900 12:00:00 AM"), timeline.GetStartDate()); Assert.AreEqual(Convert.ToDateTime("1/1/1900 12:00:00 AM"), timeline.GetEndDate()); Assert.AreEqual(1, timeline.GetTicks().Count()); TickMark first = timeline.GetTicks().First(); Assert.AreEqual(tick.GetName(), first.GetName()); Assert.AreEqual(tick.GetXPlacement(), first.GetXPlacement()); }
public void EditTickMarkTest() { TimeLine tline = new TimeLine("Test"); List<TickMark> ticklist = tline.GetTicks(); TickMark tick = ticklist.First(); Assert.AreEqual(0, tick.GetXPlacement()); tick.EditTickLocation(100, tline.GetID()); Assert.AreEqual(100, tick.GetXPlacement()); Assert.AreEqual("Test", tick.GetName()); tick.EditTickName("NewName", tline.GetID()); Assert.AreEqual("NewName", tick.GetName()); TimeLine testline = new TimeLine("Test"); List<TickMark> testticklist = testline.GetTicks(); TickMark testtick = testticklist.First(); Assert.AreEqual(100, testtick.GetXPlacement()); Assert.AreEqual("NewName", testtick.GetName()); tick.EditTickName("Test", tline.GetID()); tick.EditTickLocation(0, tline.GetID()); Assert.AreEqual(0, tick.GetXPlacement()); Assert.AreEqual("Test", tick.GetName()); }
public void CreateandDeleteTickMarkTest() { TimeLine tline = new TimeLine("Test"); TickMark tick = new TickMark("NEWTest", 0); List<TickMark> ticklist = tline.GetTicks(); Assert.AreEqual(1, ticklist.Count()); Assert.IsTrue(tline.NewTickMark(tick)); ticklist = tline.GetTicks(); Assert.AreEqual(2, ticklist.Count()); Assert.IsTrue(tline.DeleteTickMark(tick)); ticklist = tline.GetTicks(); Assert.AreEqual(1, ticklist.Count()); }
public void ClearTickMarkTest() { TimeLine tline = new TimeLine("Test"); TickMark tick = new TickMark("Test", 0); tline.ClearTicks(); List<TickMark> test = tline.GetTicks(); Assert.AreEqual(0, test.Count()); tline.NewTickMark(tick); Assert.AreEqual(1, test.Count()); }