Наследование: INotifier
Пример #1
0
 public CpuObserver(ISettingsService<AlertSettingsDto> settings, IEventService eventService, ISmtpClient client, IFile file, ILogger logger)
     : base(logger)
 {
     SettingsService = settings;
     EventService = eventService;
     SmtpClient = client;
     ConfigurationReader = new ConfigurationReader(SettingsService, AlertTypeDto.Cpu);
     Notifier = new Notifier(ConfigurationReader.Read().Intervals.CriticalNotification, eventService, client, file, logger, AlertTypeDto.Cpu);
 }
Пример #2
0
        public void Setup()
        {
            Smtp = new Mock<ISmtpClient>();
            EventService = new Mock<IEventService>();
            var logger = new Mock<ILogger>();

            EventService.Setup(x => x.RecordEvent(It.IsAny<MonitoringEventsDto>())).Returns(1);
            var fileMock = new Mock<IFile>();
            fileMock.Setup(x => x.ReadAllText(It.IsAny<string>())).Returns("<html>\\r\\n</html>");

            N = new Notifier(new TimeSpan(0, 0, 0, 1), EventService.Object, Smtp.Object, fileMock.Object, logger.Object, AlertTypeDto.Cpu);
        }