コード例 #1
0
        public void TestChargerIsConnectedIsCalledForStateAvailable()
        {
            //Default state of the station is available

            //Send event
            _reader.RFIDReadEvent += Raise.EventWith(new RFIDReaderEventArgs());

            //Check that the expected functions were called
            _charger.Received(1).IsConnected();
        }
コード例 #2
0
ファイル: TestChargeControl.cs プロジェクト: SWTGrp10/HandIn2
        public void ChargeControl_StopCharge_ConnectedIsTrue_stopChargeIsCalled()
        {
            //Arrange
            _charger           = Substitute.For <ICharger>();
            _display           = Substitute.For <IDisplay>();
            _uut               = new ChargeControl(_charger, _display);
            _charger.Connected = true;

            //Act
            _uut.StopCharge();

            //Assert
            _charger.Received().StopCharge();
        }
コード例 #3
0
        public void RfidDetected_StateAvailable_ChargerIsConnected()
        {
            rfidReader.DetectRfid += Raise.EventWith(this, new RfidChangedEventArgs());

            charger.Received(1).IsConnected();
        }