public void NextIdTest() { Heaters h = new Heaters(); Assert.AreEqual(Heaters.LastId, "aa"); Assert.AreEqual(Heaters.NextId(), "ab"); }
public void LoadHeatersTest() { List <Heater> l0 = new List <Heater> { new Heater("aa", "Kitchen", "Kitchen"), new Heater("ab", "Bathroom", "Bathroom"), new Heater("ac", "Bedroom", "Bedroom") }; Heaters heaters = new Heaters(); heaters.SetHeaters(l0); String lastId = Heaters.LastId; Data d = new Data(); d.SaveHeaters(heaters); Heaters h = d.LoadHeaters(); Assert.IsTrue(l0.Count == h.GetHeaters().Count); for (int i = 0; i < l0.Count; i++) { Assert.AreEqual(heaters.GetHeaters()[i], h.GetHeaters()[i]); } Assert.AreEqual(lastId, Heaters.LastId); }
/// <summary> /// Create a clone of this instance /// </summary> /// <returns>A clone of this instance</returns> public object Clone() { return(new Thermostatic { Control = Control, Heaters = (int[])Heaters.Clone(), Temperature = Temperature }); }
/// <summary> /// Creates a clone of this instance /// </summary> /// <returns>A clone of this instance</returns> public object Clone() { return(new Tool { Number = Number, Active = (float[])Active.Clone(), Standby = (float[])Standby.Clone(), Name = (Name != null) ? string.Copy(Name) : null, Filament = (Filament != null) ? string.Copy(Filament) : null, Fans = (int[])Fans.Clone(), Heaters = (int[])Heaters.Clone(), Mix = (float[])Mix.Clone(), Spindle = Spindle, Axes = Axes.Select(subAxes => (int[])subAxes.Clone()).ToList(), Offsets = (float[])Offsets.Clone() }); }
public void AddHeaterTest() { Heaters h = new Heaters(); h.AddHeater(new Heater(Heaters.NextId(), "a", "a")); Assert.AreEqual(Heaters.LastId, "ab"); h.AddHeater(new Heater("ac", "a", "a")); Assert.AreEqual(Heaters.LastId, "ac"); h.AddHeater(new Heater("ab", "a", "a")); Assert.AreEqual(Heaters.LastId, "ac"); h.AddHeater(new Heater("ba", "a", "a")); Assert.AreEqual(Heaters.LastId, "ba"); h.AddHeater(new Heater("bc", "a", "a")); Assert.AreEqual(Heaters.LastId, "bc"); }
public void BeforeEach() { Heaters = new Heaters(); }