Exemple #1
0
        public void JumpCommand_With_Supercruise_Payload_Does_Nothing()
        {
            var sut = new JumpCommand(_communicator, _navigator, _phrases, new Preferences());

            TestEvent testEvent = Build.An.Event.WithEvent(sut.SupportedCommand).WithPayload("JumpType", "Supercruise");

            sut.Handle(testEvent);

            _communicator.MessagesCommunicated.Should().BeEmpty();
        }
Exemple #2
0
        public void JumpCommand_With_System_Not_In_Expedition_Skips_System_And_Does_Not_Communicate()
        {
            var preferences = new Preferences()
            {
                CommunicateSkippableSystems = false
            };
            var       sut       = new JumpCommand(_communicator, _navigator, _phrases, preferences);
            TestEvent testEvent = Build.An.Event.WithEvent(sut.SupportedCommand).WithPayload("StarSystem", "Test");

            sut.Handle(testEvent);

            _communicator.MessagesCommunicated.Single().Should().Be(_phrases.Jumping.Single());
        }
Exemple #3
0
        public void JumpCommand_With_Unscanned_System_In_Expedition_Communicates()
        {
            var sut = new JumpCommand(_communicator, _navigator, _phrases, new Preferences());

            TestEvent testEvent = Build.An.Event.WithEvent(sut.SupportedCommand).WithPayload("StarSystem", _starSystems.First().Name);

            _navigator.ExtendExpedition(_starSystems);

            sut.Handle(testEvent);

            _communicator.MessagesCommunicated[0].Should().Be(_phrases.Jumping.Single());
            _communicator.MessagesCommunicated[1].Should().Contain(_phrases.Scanning.Single());
        }
Exemple #4
0
        public void JumpCommand_With_Already_Scanned_Skips_System_And_Does_Not_Communicate()
        {
            var preferences = new Preferences()
            {
                CommunicateSkippableSystems = false
            };
            var sut = new JumpCommand(_communicator, _navigator, _phrases, preferences);

            var celestial = Build.A.Celestial.ThatHasBeenScanned();
            var system    = Build.A.StarSystem.WithCelestial(celestial);
            var systems   = Build.Many.StarSystems(system);

            _navigator.ExtendExpedition(systems);

            TestEvent testEvent = Build.An.Event.WithEvent(sut.SupportedCommand).WithPayload("StarSystem", system.Name);

            sut.Handle(testEvent);

            _communicator.MessagesCommunicated.Single().Should().Be(_phrases.Jumping.Single());
        }