public void TimeLimitATest()
        {
            using (var tempFile = new TempFile())
            {
                tempFile.Text = TestResources.Mondai03;
                var mondaiDocument = MondaiDocument.Load(tempFile.Value);
                var sankouTimeA = new TimeLimitA();
                Assert.AreEqual(1d, sankouTimeA.TimeLimitTweak);

                // Shomon
                // (6 + 6 + 5) / 3 = 5.666
                var shomon = (Shomon)mondaiDocument.GetItem("2-1-2");
                Assert.AreEqual(TimeSpan.FromSeconds(5.667d), sankouTimeA.GetTimeLimit(shomon));

                // 問題文も計算対象にする
                // 問題文の英字1文字あたり0.125秒
                shomon = (Shomon)mondaiDocument.GetItem("4-2-1");
                Assert.AreEqual(TimeSpan.FromSeconds(1.5d), sankouTimeA.GetTimeLimit(shomon));

                // Ankimon
                var ankimon = (Ankimon)mondaiDocument.GetItem("3-3-1");
                Assert.AreEqual(TimeSpan.FromSeconds(10d), sankouTimeA.GetTimeLimit(ankimon));
            //				TimeLimit.Difficulty = 0.5d;
                sankouTimeA.TimeLimitTweak = 0.5d;
                Assert.AreEqual(TimeSpan.FromSeconds(5d), sankouTimeA.GetTimeLimit(ankimon));
            //				TimeLimit.Difficulty = 1d;
                sankouTimeA.TimeLimitTweak = 1d;

                // Chumon
                var chumon = (Chumon)mondaiDocument.GetItem("2-2");
                Assert.AreEqual(2, chumon.Items.Count());
                Assert.AreEqual(TimeSpan.FromSeconds(3d), sankouTimeA.GetTimeLimit(mondaiDocument.GetItem("2-2-1")));
                Assert.AreEqual(TimeSpan.FromSeconds(5d), sankouTimeA.GetTimeLimit(mondaiDocument.GetItem("2-2-2")));
                Assert.AreEqual(TimeSpan.FromSeconds(10d), sankouTimeA.GetTimeLimit(chumon));
            //				TimeLimit.Difficulty = 0.5d;
                sankouTimeA.TimeLimitTweak = 0.5d;
                Assert.AreEqual(TimeSpan.FromSeconds(1.5d + 2.5d + 2d), sankouTimeA.GetTimeLimit(chumon));
            //				TimeLimit.Difficulty = 1d;
                sankouTimeA.TimeLimitTweak = 1d;

                // text
                Assert.AreEqual(TimeSpan.FromSeconds(2.5d), sankouTimeA.GetTimeLimit("This is a pen."));
            }
        }
        public void TypingShomonTest()
        {
            string xml =
            @"<?xml version=""1.0"" encoding=""utf-8""?>
            <mondaiDocument version=""1.1"" id=""mondaiDocument1"">
            <title>Mondai Document 1</title>
            <description>Mondai Document 1の説明</description>
            <daimon id=""daimon1"">
            <title>Daimon 1</title>
            <description>Daimon 1の説明</description>
            <chumon id=""chumon1"">
            <title>Chumon 1</title>
            <description>Chumon 1の説明</description>
            <shomon id=""shomon2"">
                <question>[英訳] これはボールです。</question>
                <correctAnswer>This is a ball.</correctAnswer>
                <description></description>
                <inputMethod>typing</inputMethod>
            </shomon>
            </chumon>
            </daimon>
            </mondaiDocument>";

            /*			using (var test = new EPuzzleTestManager())
            {
                test.AddFile(@"mondai\Mondai3.xml", xml);
                test.AddFile(@"help\HelpDocument.xml", TestResources.HelpDocumentXml);
                test.Initialize();
                var window = test.Window;
                var userInfo = window.EPuzzleData.CurrentUserInfo;
                */
            using (var tempFile = new TempFile(xml))
            {
                var mondaiDocument = MondaiDocument.Load(tempFile.Name);
                var shomon = (Shomon)mondaiDocument.GetItem("shomon2");
                Assert.NotNull(shomon);

                var sankouTimeA = new TimeLimitA();
            //				TimeLimit.Difficulty = 1d;
                sankouTimeA.TimeLimitTweak = 1d;
                sankouTimeA.KeystrokesPerMinute = 400;

                Assert.AreEqual(TimeSpan.FromSeconds(4.5d), sankouTimeA.GetTimeLimit(shomon));
            }
        }