public void ReturnADataUnavailableExceptionIfTheDataFileIsNotFound()
 {
     string bogusFilePath = "April9999.abc";
     var    startDate     = DateTime.Now.Date;
     var    endDate       = startDate.AddDays(1);
     var    sourceRepo    = new MeetingSystem.Data.FileSystem.Repository(bogusFilePath);
     var    meetings      = sourceRepo.GetMeetings(startDate, endDate);
 }
        public void ReturnTheCorrectNumberOfMeetingsForAFilteredApril2017File()
        {
            var startDate  = DateTime.Parse("4/10/2017");
            var endDate    = DateTime.Parse("4/15/2017");
            var sourceRepo = new MeetingSystem.Data.FileSystem.Repository(_sourceDataFile);
            var meetings   = sourceRepo.GetMeetings(startDate, endDate);

            Assert.AreEqual(12, meetings.Count());
        }
Beispiel #3
0
        public void ThrowAMeetingSystemPermissionExceptionIfAnIoSecurityExceptionOccurs()
        {
            using (ShimsContext.Create())
            {
                System.IO.Fakes.ShimFile.ReadAllTextString =
                    p => throw new System.Security.SecurityException();

                var sourceRepo = new MeetingSystem.Data.FileSystem.Repository("April2017.abc");
                var meetings   = sourceRepo.GetMeetings(DateTime.MinValue, DateTime.MaxValue);
            }
        }
        public void ReturnTheCorrectStartDateTimeForTheLatestMeetingOfTheFile()
        {
            DateTime expected = DateTime.Parse("4/30/2017 2:00 PM");

            var startDate  = DateTime.MinValue;
            var endDate    = DateTime.MaxValue;
            var sourceRepo = new MeetingSystem.Data.FileSystem.Repository(_sourceDataFile);
            var meetings   = sourceRepo.GetMeetings(startDate, endDate);
            var actual     = meetings.OrderByDescending(m => m.StartDateTime).First();

            Assert.AreEqual(expected, actual.StartDateTime);
        }
 public void ThrowADataUnavailableExceptionIfTheSourceDataFilePathIsNotAValidMonthAndVeryShort()
 {
     var sourceRepo = new MeetingSystem.Data.FileSystem.Repository("A.csv");
     var meetings   = sourceRepo.GetMeetings(DateTime.MinValue, DateTime.MaxValue);
 }
 public void ThrowADataUnavailableExceptionIfTheSourceDataFilePathIsNull()
 {
     var sourceRepo = new MeetingSystem.Data.FileSystem.Repository(null);
     var meetings   = sourceRepo.GetMeetings(DateTime.MinValue, DateTime.MaxValue);
 }