From 0a3f5b24e4d41af8b8e1107456098d3c69a14f28 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 29 Mar 2012 18:54:29 -0700 Subject: [PATCH] Fixed broken tests. --- .../Controllers/ExceptionController.cs | 23 +++++++++---------- .../Exceptions/ExceptionRepository.cs | 4 ++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs index db7115800..c4d4010a2 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs @@ -17,7 +17,6 @@ namespace NzbDrone.Services.Service.Controllers { private readonly IDatabase _database; private readonly ExceptionRepository _exceptionRepository; - private readonly MongoDatabase _mongoDatabase; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); [Inject] @@ -76,20 +75,20 @@ namespace NzbDrone.Services.Service.Controllers report.Stack = exceptionReport.Stack; report.Uid = exceptionReport.UGuid.ToString(); - var exceptionHash = _exceptionRepository.Store(report); + _exceptionRepository.Store(report); - //var exceptionHash = GetExceptionDetailId(exceptionReport); + var exceptionHash = GetExceptionDetailId(exceptionReport); - //var exceptionInstance = new ExceptionInstance - // { - // ExceptionHash = exceptionHash, - // IsProduction = exceptionReport.IsProduction, - // LogMessage = exceptionReport.LogMessage, - // Timestamp = DateTime.Now, - // UGuid = exceptionReport.UGuid - // }; + var exceptionInstance = new ExceptionInstance + { + ExceptionHash = exceptionHash, + IsProduction = exceptionReport.IsProduction, + LogMessage = exceptionReport.LogMessage, + Timestamp = DateTime.Now, + UGuid = exceptionReport.UGuid + }; - //_database.Insert(exceptionInstance); + _database.Insert(exceptionInstance); return new JsonResult { Data = new ExceptionReportResponse { ExceptionHash = exceptionHash } }; } diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs b/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs index 1cfe99c3f..e551cebff 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs @@ -14,6 +14,10 @@ namespace NzbDrone.Services.Service.Exceptions _mongoDb = mongoDb; } + public ExceptionRepository() + { + + } public virtual string Store(NzbDrone.Services.Service.Exceptions.ExceptionReport exceptionReport) {