public void Inflect() { var inflections = Inflector.GetInflections("Вася Пупкин"); Assert.AreEqual("Вася Пупкин", inflections[0].Value); Assert.AreEqual("Васи Пупкина", inflections[1].Value); Assert.AreEqual("Васе Пупкину", inflections[2].Value); Assert.AreEqual("Васю Пупкина", inflections[3].Value); Assert.AreEqual("Васей Пупкиным", inflections[4].Value); Assert.AreEqual("Васе Пупкине", inflections[5].Value); }
private void UpdateInflectorResult() { this.Invoke(new Action(() => { try { var response = Inflector.GetInflections(tbInflectorInput.Text); if (response.Count == 6) { tbNominative.Text = response[0].Value; tbGenitive.Text = response[1].Value; tbDative.Text = response[2].Value; tbAccusative.Text = response[3].Value; tbAblative.Text = response[4].Value; tbPrepositional.Text = response[5].Value; } } catch (Exception ex) { tbNominative.Text = ""; tbGenitive.Text = ""; tbDative.Text = ""; tbAccusative.Text = ""; tbAblative.Text = ""; tbPrepositional.Text = ""; MessageBox.Show(ex.ToString(), "Error"); } })); }