public void TestConstructor() { Assert.IsNotNull(this.history.Events); History h = new History("foo.txt"); Assert.AreEqual("foo.txt", h.Filename); }
/// <summary> /// Saves the history. /// </summary> /// <param name="history">The history.</param> public static void SaveHistory(History history) { //Save history to disk using (FileStream fs = new FileStream(history.Filename, FileMode.Create)) { Serialization.ToXml(fs, history, true); } }
public void SetUp() { this.history = new History(); this.history.Filename = Path.GetTempFileName(); this.history.Events.Add(new Event(0.2M)); Gradient.GetInstance().Points.Clear(); Gradient.GetInstance().Add(new GradientPoint(100,255,0,0)); Gradient.GetInstance().Add(new GradientPoint(0, 0, 255, 0)); }
public void SetUp() { this.history = new History(); this.event1 = new Event(); this.event1.EventDate = new DateTime(2000,01,01); this.event2 = new Event(); this.event2.EventDate = new DateTime(2001,01,01); this.event3 = new Event(); this.event3.EventDate = new DateTime(2002,01,01); }
private static void Update(History history, decimal percentage) { //if exactly same coverage percentage as before don't bother updating. Event latestEvent = history.Events[0]; if (latestEvent != null && latestEvent.CoveragePercentage == percentage) { Trace.WriteLineIf(Logger.OutputType.TraceVerbose, "Not adding additional historic event as coverage percentage has not changed at " + percentage); } else { Event evnt = new Event(percentage); history.Events.Add(evnt); } }
/// <summary> /// Updates historical coverage percentages, and returns the up to date history. /// </summary> public static void Update(History history, Report report) { Update(history, report.CoveragePercentage); }