public void Reset_should_notify_property_changes() { // Assign const double V = 3.2, S = 2.0, R = 1500; var readings = new ElectricReadings(R, S); readings.AddSample(new DataSample(T1, V + 0.4)); readings.AddSample(new DataSample(T2, V + 0.5)); readings.MonitorEvents(); // Act readings.Reset(); // Assert readings.ShouldNotRaisePropertyChangeFor(m => m.Resistance); readings.ShouldNotRaisePropertyChangeFor(m => m.VoltageScale); readings.ShouldRaisePropertyChangeFor(m => m.TimeStamp); readings.ShouldRaisePropertyChangeFor(m => m.Voltage); readings.ShouldRaisePropertyChangeFor(m => m.Current); readings.ShouldRaisePropertyChangeFor(m => m.Power); readings.ShouldRaisePropertyChangeFor(m => m.Energy); }
public void SetResistance_should_notify_property_change() { // Assign const double R = 4500, S = 2.1; var readings = new ElectricReadings(R, S); readings.MonitorEvents(); // Act readings.SetResistance(R * 1.1, adjustValues: false); // Assert readings.ShouldRaisePropertyChangeFor(m => m.Resistance); }
public void SetVoltageScale_should_notify_property_change() { // Assign const double R = 4500, S = 2.1; var readings = new ElectricReadings(R, S); readings.MonitorEvents(); // Act readings.SetVoltageScale(S * 1.1, adjustValues: false); // Assert readings.ShouldRaisePropertyChangeFor(m => m.VoltageScale); }
public void Reset_should_notify_property_changes() { // Assign const double V = 3.2, S = 2.0, R = 1500; var readings = new ElectricReadings(R, S); readings.AddSample(new DataSample(T1, V + 0.4)); readings.AddSample(new DataSample(T2, V + 0.5)); readings.MonitorEvents(); // Act readings.Reset(); // Assert readings.ShouldNotRaisePropertyChangeFor(m => m.Resistance); readings.ShouldNotRaisePropertyChangeFor(m => m.VoltageScale); readings.ShouldRaisePropertyChangeFor(m => m.TimeStamp); readings.ShouldRaisePropertyChangeFor(m => m.Voltage); readings.ShouldRaisePropertyChangeFor(m => m.Current); readings.ShouldRaisePropertyChangeFor(m => m.Power); readings.ShouldRaisePropertyChangeFor(m => m.Energy); }