@ -106,19 +106,19 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
. Returns ( _config ) ;
}
protected void With MountPoint( String mountPath )
protected void Given MountPoint( String mountPath )
{
( Subject . Definition . Settings as SabnzbdSettings ) . TvCategoryLocalPath = mountPath ;
}
protected void With FailedDownload( )
protected void Given FailedDownload( )
{
Mocker . GetMock < ISabnzbdProxy > ( )
. Setup ( s = > s . DownloadNzb ( It . IsAny < Stream > ( ) , It . IsAny < String > ( ) , It . IsAny < String > ( ) , It . IsAny < int > ( ) , It . IsAny < SabnzbdSettings > ( ) ) )
. Returns ( ( SabnzbdAddResponse ) null ) ;
}
protected void With SuccessfulDownload( )
protected void Given SuccessfulDownload( )
{
Mocker . GetMock < ISabnzbdProxy > ( )
. Setup ( s = > s . DownloadNzb ( It . IsAny < Stream > ( ) , It . IsAny < String > ( ) , It . IsAny < String > ( ) , It . IsAny < int > ( ) , It . IsAny < SabnzbdSettings > ( ) ) )
@ -129,7 +129,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
} ) ;
}
protected virtual void With Queue( SabnzbdQueue queue )
protected virtual void Given Queue( SabnzbdQueue queue )
{
if ( queue = = null )
{
@ -145,7 +145,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
. Returns ( queue ) ;
}
protected virtual void With History( SabnzbdHistory history )
protected virtual void Given History( SabnzbdHistory history )
{
if ( history = = null )
history = new SabnzbdHistory ( ) { Items = new List < SabnzbdHistoryItem > ( ) } ;
@ -158,8 +158,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
[Test]
public void GetItems_should_return_no_items_when_queue_is_empty ( )
{
With Queue( null ) ;
With History( null ) ;
Given Queue( null ) ;
Given History( null ) ;
Subject . GetItems ( ) . Should ( ) . BeEmpty ( ) ;
}
@ -170,8 +170,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_queued . Items . First ( ) . Status = status ;
With Queue( _queued ) ;
With History( null ) ;
Given Queue( _queued ) ;
Given History( null ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -184,8 +184,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_queued . Items . First ( ) . Status = status ;
With Queue( _queued ) ;
With History( null ) ;
Given Queue( _queued ) ;
Given History( null ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -205,8 +205,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_queued . Items . First ( ) . Status = status ;
With Queue( _queued ) ;
With History( null ) ;
Given Queue( _queued ) ;
Given History( null ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -217,8 +217,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
[Test]
public void completed_download_should_have_required_properties ( )
{
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -230,8 +230,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_completed . Items . First ( ) . Status = SabnzbdDownloadStatus . Failed ;
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -241,7 +241,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
[Test]
public void Download_should_return_unique_id ( )
{
With SuccessfulDownload( ) ;
Given SuccessfulDownload( ) ;
var remoteEpisode = CreateRemoteEpisode ( ) ;
@ -255,8 +255,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_completed . Items . First ( ) . Category = "myowncat" ;
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var items = Subject . GetItems ( ) ;
@ -292,8 +292,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
_completed . Items . First ( ) . Title = title ;
_completed . Items . First ( ) . Storage = ( @"C:\sorted\" + title + @"\" + storage ) . AsOsAgnostic ( ) ;
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -303,10 +303,10 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
[Test]
public void should_remap_storage_if_mounted ( )
{
With MountPoint( @"O:\mymount" . AsOsAgnostic ( ) ) ;
Given MountPoint( @"O:\mymount" . AsOsAgnostic ( ) ) ;
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -318,8 +318,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_completed . Items . First ( ) . Storage = @"C:\" . AsOsAgnostic ( ) ;
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -331,8 +331,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
_completed . Items . First ( ) . Storage = @"C:\sorted\somewhere\asdfasdf\asdfasdf.mkv" . AsOsAgnostic ( ) ;
With Queue( null ) ;
With History( _completed ) ;
Given Queue( null ) ;
Given History( _completed ) ;
var result = Subject . GetItems ( ) . Single ( ) ;
@ -349,7 +349,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
_config . Misc . complete_dir = completeDir ;
_config . Categories . First ( ) . Dir = categoryDir ;
With Queue( null ) ;
Given Queue( null ) ;
var result = Subject . GetStatus ( ) ;
@ -361,9 +361,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
[Test]
public void should_return_status_with_mounted_outputdir ( )
{
With MountPoint( @"O:\mymount" . AsOsAgnostic ( ) ) ;
Given MountPoint( @"O:\mymount" . AsOsAgnostic ( ) ) ;
With Queue( null ) ;
Given Queue( null ) ;
var result = Subject . GetStatus ( ) ;