public void TestBooleanChecks() { var tools = new KanaTools(); Assert.IsTrue(tools.IsHiragana("ものの")); Assert.IsFalse(tools.IsHiragana("キョクタン")); Assert.IsFalse(tools.IsHiragana("romaji")); Assert.IsTrue(tools.IsKatakana("キョクタン")); Assert.IsTrue(tools.IsKana("キョクタンものの")); Assert.IsTrue(tools.IsRomaji("romaji")); }
private void btnLookup_Click(object sender, EventArgs e) { KanaTools kt = new KanaTools(); txtCharacter.Text = kt.ToHiragana(txtCharacter.Text); Dictionary <string, string> parameters = new Dictionary <string, string>(); if (kt.IsHiragana(txtCharacter.Text)) { parameters.Add("characters", txtCharacter.Text); } else { parameters.Add("ids", txtCharacter.Text); } List <Subject> subjectList = Subject.BuildSubjectList(txtCharacter.Text); rtbJson.Text = Subject.GetAllSubjects(parameters); }