コード例 #1
0
        internal static void ExportAllData()
        {
            StringBuilder   sb    = new StringBuilder();
            ProgressCommand c     = new ProgressCommand();
            ProgressCommand child = TreeCenter.GetExportAllCommand();

            if (child != null)
            {
                sb.Append("Tree export \r\n");
                c.Add(child);
            }
            child = MachineCenter.GetExportCommand();
            if (child != null)
            {
                sb.Append("Machine export \r\n");
                c.Add(child);
            }
            c.notify  = sb.ToString();
            c.refresh = true;
            c.StartCommand();
        }
コード例 #2
0
        public void ProgressCommand_Communicates_Progress()
        {
            TestCommunicator       communicator = CreateCommunicator();
            Navigator              navigator    = CreateNavigator();
            PlayerStatusRepository playerStatus = CreatePlayerStatusRepository();
            ProgressPhrases        phrases      = TestPhraseBuilder.Build <ProgressPhrases>();

            ProgressCommand sut = new ProgressCommand(communicator, navigator, playerStatus, phrases);

            Celestial         celestial = Build.A.Celestial;
            List <StarSystem> systems   = Build.A.StarSystem.WithCelestials(celestial).InAList();

            navigator.PlanExpedition(systems);

            TestEvent testEvent = Build.An.Event.WithEvent(sut.SupportedCommand);

            sut.Handle(testEvent);

            communicator.MessagesCommunicated[0].Should().Be(phrases.Progress.Single());
            communicator.MessagesCommunicated[1].Should().Be(phrases.SystemsScanned.Single());
            communicator.MessagesCommunicated[2].Should().Be(phrases.CreditsEarned.Single());
        }