示例#1
0
 public void GetPersonTypeByCategories()
 {
     Assert.AreEqual(
         PersonType.Human,
         PersonImporter.GetPersonTypeByCategories(new[] { "Human", "Category:Organization" }));
     Assert.AreEqual(
         PersonType.Organization,
         PersonImporter.GetPersonTypeByCategories(new[] { "Category:Person", "Category:Organization" }));
     Assert.AreEqual(
         PersonType.Dynasty,
         PersonImporter.GetPersonTypeByCategories(new[] { "Person", "Dynasty", "Human" }));
     Assert.AreEqual(
         PersonType.Person,
         PersonImporter.GetPersonTypeByCategories(null));
 }
        public void ShouldReadPeopleFile()
        {
            var importer = new PersonImporter();
            var people = importer.Read("InputFiles\\People.txt").ToArray();

            people.Length.ShouldEqual(2);

            people[0].Name.ShouldEqual("John Doe");
            people[0].Birthday.ShouldEqual(new DateTime(1990, 1, 2));
            people[0].Email.ShouldEqual("*****@*****.**");
            people[0].Hobbies.ShouldEqual("Tennis");

            people[1].Name.ShouldEqual("Jane Doe");
            people[1].Birthday.ShouldEqual(new DateTime(1991, 2, 3));
            people[1].Email.ShouldEqual("*****@*****.**");
            people[1].Hobbies.ShouldEqual("Soccer Cycling");
        }
示例#3
0
 public PersonImporterForm()
 {
     InitializeComponent();
     personImpoter = new PersonImporter();
 }