コード例 #1
0
        public void When_releasing_next_competitor_while_number_entry_is_no_longer_active_it_must_ignore()
        {
            // Arrange
            var filter = new NumberEntryFilter();
            filter.HandleModifierKeyDown(OtherRemoteControl, RemoteKeyModifier.EnterNextCompetitor);
            filter.HandleModifierKeyDown(ThisRemoteControl, RemoteKeyModifier.EnterNextCompetitor);
            filter.HandleModifierKeyUp(OtherRemoteControl, RemoteKeyModifier.EnterNextCompetitor);

            // Act
            using (var listener = new FilterEventListener(filter))
            {
                filter.HandleModifierKeyUp(ThisRemoteControl, RemoteKeyModifier.EnterNextCompetitor);

                // Assert
                listener.EventsCollected.Should().BeEmpty();
            }
        }
コード例 #2
0
            When_releasing_current_competitor_while_others_are_building_current_competitor_number_it_must_end_number_building
            ()
        {
            // Arrange
            var filter = new NumberEntryFilter();
            filter.HandleModifierKeyDown(OtherRemoteControl, RemoteKeyModifier.EnterCurrentCompetitor);
            filter.HandleKeyDown(OtherRemoteControl, RemoteKey.Key4, NullTime);
            filter.HandleModifierKeyDown(ThisRemoteControl, RemoteKeyModifier.EnterCurrentCompetitor);

            // Act
            using (var listener = new FilterEventListener(filter))
            {
                filter.HandleModifierKeyUp(ThisRemoteControl, RemoteKeyModifier.EnterCurrentCompetitor);

                // Assert
                listener.EventsCollected.Should().HaveCount(1);
                listener.EventsCollected[0].ShouldBeNotifyCompetitorSelected(true, 4);
            }
        }
コード例 #3
0
        public void When_releasing_current_competitor_without_numbers_it_must_cancel_number_building()
        {
            // Arrange
            var filter = new NumberEntryFilter();
            filter.HandleModifierKeyDown(ThisRemoteControl, RemoteKeyModifier.EnterCurrentCompetitor);

            // Act
            using (var listener = new FilterEventListener(filter))
            {
                filter.HandleModifierKeyUp(ThisRemoteControl, RemoteKeyModifier.EnterCurrentCompetitor);

                // Assert
                listener.EventsCollected.Should().HaveCount(1);
                listener.EventsCollected[0].ShouldBeNotifyCompetitorSelectCancelled(true);
            }
        }