private Person MakeMelinda() { var p = new Person() { FirstName = "Melinda" }; return p; }
private Person MakeQuentin() { var p = new Person() { FullName = "Quentin Starin", Birthday = new DateTime(1981, 02, 15), Address = new Address("101 1st Ave", "Minneapolis", States.Minnesota, "55401"), Friends = new Person[] { new Person() { FullName = "John Smith", Birthday = new DateTime(1978, 1, 1) }, new Person() { FullName = "Bob Johnson", Birthday = new DateTime(1957, 1, 1) }, new Person() { FullName = "Mary Meyer", Birthday = new DateTime(1990, 1, 1) }, new Person() { FullName = "Dr. Jamal Cornucopia", Birthday = new DateTime(1973, 1, 1) } } }; return p; }
public void ComplexConditionFirstMatchingCase() { var p1 = new Person() { Birthday = DateTime.MinValue }; var formatString = "{Age:>=55?Senior Citizen|>=30?Adult|>=18?Young Adult|>12?Teenager|>2?Child|Baby}"; var expectedOutput = "Senior Citizen"; string actualOutput = formatString.FormatEx(p1); Assert.AreEqual(expectedOutput, actualOutput); }