public IndexerRepository(Interface.Repository.IQueueRepository queueRepository, Interface.Repository.IFileRepository fileRepository, Interface.Service.IExceptionLogService exceptionLogService) { this.queueRepository = queueRepository; this.fileRepository = fileRepository; this.exceptionLogService = exceptionLogService; serviceClient = new SearchServiceClient(Common.Setting.SettingService.AzureSearchName, new SearchCredentials(Common.Setting.SettingService.AzureSearchApiKey)); }
public void LogException() { System.Exception ex = new System.Exception("Unit test exception: " + Guid.NewGuid().ToString()); Interface.Service.IExceptionLogService exceptionLogService = DI.Container.Resolve <Interface.Service.IExceptionLogService>(); Guid exceptionLogId = Guid.NewGuid(); exceptionLogService.Save(ex, exceptionLogId); Model.ExceptionLog.ExceptionLogModel exceptionLogModel = exceptionLogService.Get(exceptionLogId); Assert.AreEqual(exceptionLogModel.ExceptionMessage, ex.Message); }