public async Task LegacyScan_NonRollTest()
        {
            var message0 = TestLazySocketMessage.CreateMentionedMessage("scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("hooray!");

            await Scan_NonRollTestCore(message0, message1);
        }
        public async Task Scan_WrongRollTest()
        {
            var message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("2d100");

            await Scan_WrongRollTestCore(message0, message1);
        }
        public async Task LegacyScan_OneRollTest()
        {
            var message0 = TestLazySocketMessage.CreateMentionedMessage("scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("1d100");
            var message2 = TestLazySocketMessage.CreateMentionedMessage("scan-end");

            await Scan_OneRollTestCore(message0, message1, message2);
        }
        public async Task LegacyScan_DiceOption_OneBigRollTest()
        {
            TestLazySocketMessage message0 = TestLazySocketMessage.CreateMentionedMessage("scan-start --dice 100000000000000000000+1d100");
            TestLazySocketMessage message1 = TestLazySocketMessage.CreateNoMentionMessage("100000000000000000000+1d100");
            TestLazySocketMessage message2 = TestLazySocketMessage.CreateMentionedMessage("scan-end");

            await Scan_DiceOption_OneBigRollTestCore(message0, message1, message2);
        }
        public async Task ScanStart_DuplicateTest()
        {
            var message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            var message2 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end");

            await Scan_TwoUsersTestCore(message0, message1, message2);
        }
        public async Task ScanStart_TimeLimitTest()
        {
            TestLazySocketMessage message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            TestLazySocketMessage message1 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end");
            TestLazySocketMessage message2 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");

            await ScanStart_TimeLimitTestCore(message0, message1, message2);
        }
        public async Task ScanShowTest()
        {
            var message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("1d100");
            var message2 = TestLazySocketMessage.CreateNoMentionMessage("!scan-show");

            await ScanShowTestCore(message0, message1, message2);
        }
        public async Task LegacyScanShow_NoCacheTest()
        {
            var message0 = TestLazySocketMessage.CreateMentionedMessage("scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("1d100");
            var message2 = TestLazySocketMessage.CreateMentionedMessage("scan-end");
            var message3 = TestLazySocketMessage.CreateMentionedMessage("scan-show");

            await ScanShow_NoCacheTestCore(message0, message1, message2, message3);
        }
        public async Task Scan_TwoRollsTest()
        {
            var message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("1d100");
            var message2 = TestLazySocketMessage.CreateNoMentionMessage("1d100");
            var message3 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end");

            await Scan_TwoRollsTestCore(message0, message1, message2, message3);
        }
        public async Task ScanShow_CacheTest()
        {
            TestLazySocketMessage message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            TestLazySocketMessage message1 = TestLazySocketMessage.CreateNoMentionMessage("!1d100");
            TestLazySocketMessage message2 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end");
            TestLazySocketMessage message3 = TestLazySocketMessage.CreateNoMentionMessage("!scan-show");

            await ScanShow_CacheTestCore(message0, message1, message2, message3);
        }
        public async Task Scan_TwoUsersTest()
        {
            var message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start", TestLazySocketUser.Author);
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start", TestLazySocketUser.NonAuthor);
            var message2 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end", TestLazySocketUser.Author);
            var message3 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end", TestLazySocketUser.NonAuthor);

            await Scan_TwoUsersTestCore(message0, message1, message2, message3);
        }
        public async Task LegacyScan_TieBreakTest()
        {
            var message0 = TestLazySocketMessage.CreateMentionedMessage("scan-start --dice 1d1", TestLazySocketUser.Author);
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("1d1", TestLazySocketUser.Author);
            var message2 = TestLazySocketMessage.CreateNoMentionMessage("1d1", TestLazySocketUser.NonAuthor);
            var message3 = TestLazySocketMessage.CreateMentionedMessage("scan-end");

            await Scan_TieBreakTestCore(message0, message1, message2, message3);
        }
        async Task Plain_NoMentionTestCore(string text)
        {
            ulong botCurrentUserId = TestLazySocketUser.MyBot.Id;

            var(allCommands, testObserver, _) = Init();

            await allCommands.ReceiveMessageAsync(TestLazySocketMessage.CreateNoMentionMessage(text), botCurrentUserId);

            AssertEx.IsEmpty(testObserver.Messages);
        }
        public async Task RollByFullWidth_NoMentionTest()
        {
            ulong botCurrentUserId = TestLazySocketUser.MyBot.Id;

            var(allCommands, testObserver, _) = Init();

            await allCommands.ReceiveMessageAsync(TestLazySocketMessage.CreateNoMentionMessage("1d100"), botCurrentUserId);

            AssertEx.ExactlyOneSay(testObserver.Messages);
        }
        public async Task Roll_TooLongExprTest()
        {
            ulong botCurrentUserId = TestLazySocketUser.MyBot.Id;

            var(allCommands, testObserver, _) = Init();

            await allCommands.ReceiveMessageAsync(TestLazySocketMessage.CreateNoMentionMessage("2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6+2d6"), botCurrentUserId);

            AssertEx.ExactlyOneCaution(testObserver.Messages);
        }
        public async Task LegacyScanEnd_NoMentionTest()
        {
            ulong botCurrentUserId = TestLazySocketUser.MyBot.Id;

            var(allCommands, testObserver, _) = Init();

            await allCommands.ReceiveMessageAsync(TestLazySocketMessage.CreateNoMentionMessage("scan-end"), botCurrentUserId);

            AssertEx.IsEmpty(testObserver.Messages);
        }
        public async Task ScanEnd_DuplicateTest()
        {
            ulong botCurrentUserId = TestLazySocketUser.MyBot.Id;

            var(allCommands, testObserver, _) = Init();

            var message0 = TestLazySocketMessage.CreateNoMentionMessage("!scan-start");
            var message1 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end");
            var message2 = TestLazySocketMessage.CreateNoMentionMessage("!scan-end");

            await ScanEnd_DuplicateTestCore(message0, message1, message2);
        }