Exemplo n.º 1
0
        /// <summary>
        /// Insere a entidade
        /// </summary>
        public virtual void Insert(TEntity entity)
        {
            entity.CreatedAt = entity.ModifiedAt = _clock.GetNow();
            entity.CreatedBy = entity.ModifiedBy = Thread.CurrentPrincipal.Identity.Name;

            _unitOfWork.RegisterInsert(entity);
        }
 public void SetUp()
 {
     _substituteICache = Substitute.For<ICache>();
     _substituteForIClock = Substitute.For<IClock>();
     _now = DateTime.Now;
     _substituteForIClock.GetNow().Returns(_now);
 }
Exemplo n.º 3
0
        private void Tick(object state)
        {
            var currentDate = _clock.GetNow();
            var tolerance   = TimeSpan.FromMilliseconds(500);

            for (var i = PrayerType.Fajr; i <= PrayerType.Isha; i++)
            {
                var prayerDate = _prayerDay.GetPrayerDate(i);

                if (prayerDate.IsEqual(currentDate, tolerance))
                {
                    OnPrayerTime(_prayerDay, i);
                    return; // Multiple Prayer times can never be at the same time
                }
            }
        }
Exemplo n.º 4
0
 public DateTime Get()
 {
     return(clock.GetNow());
 }