public void ParseTest_Success()
        {
            var ob1Str = new string[]
            {
                "First1", "Last1", Gender.Female.ToString(), "Green", DateTime.Now.AddYears(-30).ToString("MM/dd/yyyy")
            };
            var ob2Str = new string[]
            {
                "First2", "Last2", Gender.Male.ToString(), "Red", DateTime.Now.AddYears(-40).ToString("MM/dd/yyyy")
            };

            var str1 = string.Join(" ", ob1Str);
            var str2 = string.Join(" ", ob2Str);

            var ob1 = new Record();
            var ob2 = new Record();
            
            _splitter.Setup(x => x.CanSplit(str1)).Returns(true);
            _splitter.Setup(x => x.Split(str1)).Returns(ob1Str);
            _splitter.Setup(x => x.Split(str2)).Returns(ob2Str);

            _converter.Setup(x => x.Convert(ob1Str)).Returns(ob1);
            _converter.Setup(x => x.Convert(ob2Str)).Returns(ob2);

            var result = _sut.Parse(new string[] { str1, str2 }).ToArray();

            Assert.AreEqual(ob1, result[0]);
            Assert.AreEqual(ob2, result[1]);
            _splitter.VerifyAll();
            _converter.VerifyAll();
        }
        public void SortTest()
        {
            var rec1 = new Record { Gender = Gender.Male };
            var rec2 = new Record { Gender = Gender.Female };
            var rec3 = new Record { Gender = Gender.Female };
            var rec4 = new Record { Gender = Gender.Male };

            var records = new Record[] { rec1, rec2, rec3, rec4 };

            var result = _sut.Sort(records).ToArray();

            Assert.AreEqual(rec1, result[0]);
            Assert.AreEqual(rec4, result[1]);
            Assert.AreEqual(rec2, result[2]);
            Assert.AreEqual(rec3, result[3]);
        }
        public void SortTest()
        {
            var rec1 = new Record { DateOfBirth = DateTime.Now };
            var rec2 = new Record { DateOfBirth = DateTime.Now.AddYears(-5) };
            var rec3 = new Record { DateOfBirth = DateTime.Now.AddYears(5) };
            var rec4 = new Record { DateOfBirth = DateTime.Now.AddYears(-10) };

            var records = new Record[] { rec1, rec2, rec3, rec4 };

            var result = _sut.Sort(records).ToArray();

            Assert.AreEqual(rec4, result[0]);
            Assert.AreEqual(rec2, result[1]);
            Assert.AreEqual(rec1, result[2]);
            Assert.AreEqual(rec3, result[3]);

        }
        public void SortTest()
        {
            var rec1 = new Record { LastName = "A" };
            var rec2 = new Record { LastName = "C" };
            var rec3 = new Record { LastName = "D" };
            var rec4 = new Record { LastName = "B" };

            var records = new Record[] { rec1, rec2, rec3, rec4 };

            var result = _sut.Sort(records).ToArray();

            Assert.AreEqual(rec3, result[0]);
            Assert.AreEqual(rec2, result[1]);
            Assert.AreEqual(rec4, result[2]);
            Assert.AreEqual(rec1, result[3]);

        }
 public void PrintRecordTest()
 {
     var record = new Record { FirstName = "First", LastName = "Last", DateOfBirth = DateTime.Now, FavoriteColor = "Red", Gender = Gender.Female };
     Assert.AreEqual(string.Format("Record: {0} {1} {2} {3:MM/dd/yyyy} {4}", record.FirstName, record.LastName, record.Gender, record.DateOfBirth, record.FavoriteColor), _sut.PrintRecord(record));
 }