public IEnumerable <Notification> GetNotificationsAfter(DateTime inclusiveStartTime) { using (var myAdapter = _persistenceLayer.GetDataAccessAdapter()) { var linqMetaData = new LinqMetaData(myAdapter); return(_notificationMapper.MapMultiple(NotificationEntities(linqMetaData).Where(n => n.DateCreated >= inclusiveStartTime)).ToList()); } }
public void GetConfigurationValueReturnsEpochDateWhenEpochNameSettingGiven() { Expect.Call(_persistenceLayer.GetDataAccessAdapter()).Return(_dataAccessAdapter); Expect.Call(() => _dataAccessAdapter.FetchEntityCollection(null, null)).IgnoreArguments(). Callback(new FetchEntityCollectionDelegate(FetchEntityCollection)); Expect.Call(_dataAccessAdapter.Dispose); _mocks.ReplayAll(); string epochDateString = _repository.GetConfigurationValue(ConfigurationSettingName.EpochDate); _mocks.VerifyAll(); var epochDate = DateTime.Parse(epochDateString); Assert.AreEqual(DateTime.Parse(_expectedDateString), epochDate); }
protected void ExpectGetDataAccessAdapterAndDispose(int numberOfTimesToExpect) { Expect.Call(_persistenceLayer.GetDataAccessAdapter()).Return(_dataAccessAdapter).Repeat.Times(numberOfTimesToExpect); Expect.Call(_dataAccessAdapter.Dispose).Repeat.Times(numberOfTimesToExpect); }