pszczyg

Mockowanie DateTime - kod na produkcji

Jun 20th, 2017
301
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void DoPeriodicCheckIfNeeded()
  2. {
  3.     var isItTimeForPeriodicCheck = TimeForNextPeriodicCheck < DateTime.Now;
  4.     if (!isItTimeForPeriodicCheck)
  5.         return;
  6.  
  7.     DoPeriodicalCheckForMetersWithoutValues();
  8.  
  9.     TimeForNextPeriodicCheck = ComputeTimeForNextCheck();
  10. }
RAW Paste Data