Пример #1
0
   private static string ConjugationWorks(
 IConjugation conj,
 string sing1,
 string sing2,
 string sing3,
 string plu1,
 string plu2,
 string plu3)
   {
       var lookup
       = new Dictionary<Tuple<Person, Number>, string>
         {
       {new Tuple<Person, Number>(Person.First, Number.Singular), sing1},
       {new Tuple<Person, Number>(Person.Second, Number.Singular), sing2},
       {new Tuple<Person, Number>(Person.Third, Number.Singular), sing3},
       {new Tuple<Person, Number>(Person.First, Number.Plural), plu1},
       {new Tuple<Person, Number>(Person.Second, Number.Plural), plu2},
       {new Tuple<Person, Number>(Person.Third, Number.Plural), plu3},
         };
         return string.Join("; ",
                    lookup
                      .Where(kvp => !Agrees(conj, kvp.Key.Item1, kvp.Key.Item2, kvp.Value))
                      .Select(
                        kvp =>
                        string.Format("Expected '{0}', but got '{1}'", kvp.Value,
                                      conj.Get(kvp.Key.Item1, kvp.Key.Item2))));
   }
Пример #2
0
 protected static bool Agrees(IConjugation conj, Person person, Number number, string value)
 {
     return conj.Get(person, number) == value;
 }