From f78c5f2124b625af8ada27e1fd1b860bf424c1e0 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 17 Oct 2011 13:20:09 -0700 Subject: [PATCH] Fixed a couple tests, so they shouldn't fail due to other tests impacting them. --- NzbDrone.Core.Test/ConfigFileProviderTest.cs | 4 +++- NzbDrone.Core.Test/PostDownloadProviderTest.cs | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/NzbDrone.Core.Test/ConfigFileProviderTest.cs b/NzbDrone.Core.Test/ConfigFileProviderTest.cs index cf02dae96..abbfb8e4c 100644 --- a/NzbDrone.Core.Test/ConfigFileProviderTest.cs +++ b/NzbDrone.Core.Test/ConfigFileProviderTest.cs @@ -19,7 +19,9 @@ namespace NzbDrone.Core.Test //Reset config file var mocker = new AutoMoqer(); var configFile = mocker.Resolve().ConfigFile; - File.Delete(configFile); + + if (File.Exists(configFile)) + File.Delete(configFile); mocker.Resolve().CreateDefaultConfigFile(); } diff --git a/NzbDrone.Core.Test/PostDownloadProviderTest.cs b/NzbDrone.Core.Test/PostDownloadProviderTest.cs index 67e9eb735..4ffe4af05 100644 --- a/NzbDrone.Core.Test/PostDownloadProviderTest.cs +++ b/NzbDrone.Core.Test/PostDownloadProviderTest.cs @@ -73,18 +73,22 @@ namespace NzbDrone.Core.Test var postDownloadStatus = PostDownloadStatusType.Failed; var postDownloadProvider = new PostDownloadProvider(); - postDownloadProvider.Add(new PostDownloadInfoModel - { - Name = path, - Status = postDownloadStatus, - Added = DateTime.Now.AddMinutes(-5) - }); + + var model = new PostDownloadInfoModel + { + Name = path, + Status = postDownloadStatus, + Added = DateTime.Now.AddMinutes(-5) + }; + + postDownloadProvider.Add(model); //Act mocker.Resolve().ProcessFailedOrUnpackingDownload(new DirectoryInfo(Path.Combine(Directory.GetCurrentDirectory(), path)), postDownloadStatus); //Assert mocker.VerifyAllMocks(); + postDownloadProvider.Remove(model); } [Test]