Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     bicycle = new BicycleMointor();
     observer = new Observer(lblRPM, bicycle);
     cph = new CPHObserver(lblCPH, bicycle);
     kph = new KPHObserver(lblKPH, bicycle);
 }
Esempio n. 2
0
        public void KPHObserver_ComputeCurrentValue()
        {
            SpeedMonitorSubject subject = new SpeedMonitorSubject();
            Label label = new Label();
            BicycleObserver observer = new KPHObserver(label, subject);
            int rpm = 60;
            String expectedOutput = "7.38";

            observer.Update(rpm);

            Assert.AreEqual(label.Text, expectedOutput);
        }