예제 #1
0
        protected virtual void GivenHistory(SabnzbdHistory history)
        {
            if (history == null)
            {
                history = new SabnzbdHistory()
                {
                    Items = new List <SabnzbdHistoryItem>()
                };
            }

            Mocker.GetMock <ISabnzbdProxy>()
            .Setup(s => s.GetHistory(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), It.IsAny <SabnzbdSettings>()))
            .Returns(history);
        }
예제 #2
0
        public void Setup()
        {
            Subject.Definition          = new DownloadClientDefinition();
            Subject.Definition.Settings = new SabnzbdSettings
            {
                Host             = "127.0.0.1",
                Port             = 2222,
                ApiKey           = "5c770e3197e4fe763423ee7c392c25d1",
                Username         = "******",
                Password         = "******",
                MusicCategory    = "tv",
                RecentTvPriority = (int)SabnzbdPriority.High
            };
            _queued = new SabnzbdQueue
            {
                DefaultRootFolder = @"Y:\nzbget\root".AsOsAgnostic(),
                Paused            = false,
                Items             = new List <SabnzbdQueueItem>()
                {
                    new SabnzbdQueueItem
                    {
                        Status   = SabnzbdDownloadStatus.Downloading,
                        Size     = 1000,
                        Sizeleft = 10,
                        Timeleft = TimeSpan.FromSeconds(10),
                        Category = "tv",
                        Id       = "sabnzbd_nzb12345",
                        Title    = "Droned.S01E01.Pilot.1080p.WEB-DL-DRONE"
                    }
                }
            };

            _failed = new SabnzbdHistory
            {
                Items = new List <SabnzbdHistoryItem>()
                {
                    new SabnzbdHistoryItem
                    {
                        Status   = SabnzbdDownloadStatus.Failed,
                        Size     = 1000,
                        Category = "tv",
                        Id       = "sabnzbd_nzb12345",
                        Title    = "Droned.S01E01.Pilot.1080p.WEB-DL-DRONE"
                    }
                }
            };

            _completed = new SabnzbdHistory
            {
                Items = new List <SabnzbdHistoryItem>()
                {
                    new SabnzbdHistoryItem
                    {
                        Status   = SabnzbdDownloadStatus.Completed,
                        Size     = 1000,
                        Category = "tv",
                        Id       = "sabnzbd_nzb12345",
                        Title    = "Droned.S01E01.Pilot.1080p.WEB-DL-DRONE",
                        Storage  = "/remote/mount/vv/Droned.S01E01.Pilot.1080p.WEB-DL-DRONE"
                    }
                }
            };

            _config = new SabnzbdConfig
            {
                Misc = new SabnzbdConfigMisc
                {
                    complete_dir = @"/remote/mount"
                },
                Categories = new List <SabnzbdCategory>
                {
                    new SabnzbdCategory  {
                        Name = "tv", Dir = "vv"
                    }
                }
            };

            Mocker.GetMock <ISabnzbdProxy>()
            .Setup(v => v.GetVersion(It.IsAny <SabnzbdSettings>()))
            .Returns("1.2.3");

            Mocker.GetMock <ISabnzbdProxy>()
            .Setup(s => s.GetConfig(It.IsAny <SabnzbdSettings>()))
            .Returns(_config);

            _fullStatus = new SabnzbdFullStatus
            {
                CompleteDir = @"Y:\nzbget\root\complete".AsOsAgnostic()
            };

            Mocker.GetMock <ISabnzbdProxy>()
            .Setup(s => s.GetFullStatus(It.IsAny <SabnzbdSettings>()))
            .Returns(_fullStatus);
        }