Пример #1
0
        public void ByLastNamePeopleReport_GetReport_Success()
        {
            var person =
                new GrHw.Client.Domain.Person
            {
                LastName      = "Beatty",
                FirstName     = "Brian",
                Gender        = "M",
                DateOfBirth   = "3/14/90",
                FavoriteColor = "Green"
            };
            var expected = "Beatty,Brian,M,Green,3/14/1990";
            var report   = GetPersonLineProcessor();
            var actual   = report.ToLine(person, ',');

            Assert.AreEqual(expected, actual);
            VerifyAll();
        }
Пример #2
0
        public void PersonLineProcessor_ParseLine_Success()
        {
            var contents = new[] { "Beatty", "Brian", "M", "Green", "3/14/70" };
            var expected = new GrHw.Client.Domain.Person
            {
                LastName      = "Beatty",
                FirstName     = "Brian",
                DateOfBirth   = "3/14/1970",
                FavoriteColor = "Green",
                Gender        = "M"
            };
            var processor = GetPersonLineProcessor();
            var actual    = processor.ParseLine(contents);

            Assert.AreEqual(expected.LastName, actual.LastName, "LastName");
            Assert.AreEqual(expected.FirstName, actual.FirstName, "FirstName");
            Assert.AreEqual(expected.DateOfBirth, actual.DateOfBirth, "DateOfBirth");
            Assert.AreEqual(expected.FavoriteColor, actual.FavoriteColor, "FavoriteColor");
            Assert.AreEqual(expected.Gender, actual.Gender, "Gender");
            VerifyAll();
        }