Esempio n. 1
0
        public virtual string InflectMiddleNameTo(Case @case)
        {
            Guard.IfArgumentNullOrWhitespace(MiddleName, "FirstName", "Middle name was not provided");

            if (AutoDetectGender) DetectGender();

            return MiddleName = new CaseInflection(provider, Gender).InflectMiddleNameTo(MiddleName, @case);
        }
Esempio n. 2
0
        public virtual Petrovich InflectTo(Case @case)
        {
            Guard.IfArgumentNullOrWhitespace(FirstName, "FirstName", "First name was not provided");
            Guard.IfArgumentNullOrWhitespace(LastName, "LastName", "Last name was not provided");
            Guard.IfArgumentNullOrWhitespace(MiddleName, "MiddleName", "Middle name was not provided");

            var inflected = new Petrovich();

            if (AutoDetectGender) DetectGender();

            var inflection = new CaseInflection(provider, Gender);

            inflected.FirstName = inflection.InflectFirstNameTo(FirstName, @case);
            inflected.LastName = inflection.InflectLastNameTo(LastName, @case);
            inflected.MiddleName = inflection.InflectMiddleNameTo(MiddleName, @case);

            return inflected;
        }
 public void Should_inflect_middle_name_correctly(string middleName, Gender gender, Case @case, string expected)
 {
     var actual = new CaseInflection(provider, gender).InflectMiddleNameTo(middleName, @case);
     Assert.AreEqual(expected, actual, string.Format("Gender: {0}, Case: {1}", gender, @case));
 }
 public void Should_inflect_last_name_correctly(string lastName, Gender gender, Case @case, string expected)
 {
     var actual = new CaseInflection(gender).InflectLastNameTo(lastName, @case);
     Assert.AreEqual(expected, actual, string.Format("Gender: {0}, Case: {1}", gender, @case));
 }