public void Constructor_RepositoryIsNull_ThrowsException() { // Arrange var exeHandlerMock = new Mock <IExceptionHandler>(); var validatorMock = new Mock <IValidator <DateTime> >(); IPottyBreakRepository nullRepo = null; // Act Assert.Throws <ArgumentNullException>(() => Instance = new PottyBreaksManager(exeHandlerMock.Object, nullRepo, validatorMock.Object)); }
public PottyBreaksManager(IPottyBreakRepository pottyBreakRepository, IValidator <DateTime> dateEntryValidator, ISimpleCache <Guid, PottyBreak> simpleCache) { if (pottyBreakRepository is null) { throw new ArgumentNullException(nameof(pottyBreakRepository)); } if (dateEntryValidator is null) { throw new ArgumentNullException(nameof(dateEntryValidator)); } if (simpleCache is null) { throw new ArgumentException(nameof(simpleCache)); } _pottyBreakRepository = pottyBreakRepository; _dateEntryValidator = dateEntryValidator; _simpleCache = simpleCache; }