Beispiel #1
0
        public void BijSwitchMeFliptDeToestand()
        {
            // Arrange
            var target       = new Switch();
            var listenerMock = new ListenerMock();

            target.Switched += listenerMock.SwitchHandled;

            // Act
            target.SwitchMe();

            // Assert
            Assert.IsTrue(listenerMock.SwitchedEventArgs.State);
        }
Beispiel #2
0
        public void BijSwitchMeWordtDeMethodeAangeroepenDieWeHebbenToegevoegd()
        {
            // Arrange
            var target       = new Switch();
            var listenerMock = new ListenerMock();

            target.Switched += listenerMock.SwitchHandled;

            // Act
            target.SwitchMe();

            // Assert
            Assert.IsTrue(listenerMock.SwitchHandledHasBeenCalled);
        }
Beispiel #3
0
        public void BijRemoveWordtDeMethodeNietMeerAangeroepen()
        {
            // Arrange
            var target       = new Switch();
            var listenerMock = new ListenerMock();

            target.Switched += listenerMock.SwitchHandled;

            // Act
            target.Switched -= listenerMock.SwitchHandled;
            target.SwitchMe();

            // Assert
            Assert.IsFalse(listenerMock.SwitchHandledHasBeenCalled);
        }