public static DelayProfileResource ToResource(this DelayProfile model) { if (model == null) { return(null); } return(new DelayProfileResource { Id = model.Id, EnableUsenet = model.EnableUsenet, EnableTorrent = model.EnableTorrent, PreferredProtocol = model.PreferredProtocol, UsenetDelay = model.UsenetDelay, TorrentDelay = model.TorrentDelay, Order = model.Order, Tags = new HashSet <int>(model.Tags) }); }
public void Setup() { _delayProfiles = Builder <DelayProfile> .CreateListOfSize(4) .TheFirst(1) .With(d => d.Order = int.MaxValue) .TheNext(1) .With(d => d.Order = 1) .TheNext(1) .With(d => d.Order = 2) .TheNext(1) .With(d => d.Order = 3) .Build() .ToList(); _first = _delayProfiles[1]; _last = _delayProfiles.Last(); Mocker.GetMock <IDelayProfileRepository>() .Setup(s => s.All()) .Returns(_delayProfiles); }
protected private bool TryGetDelayProfileById(int id, out DelayProfile foundProfile) { foundProfile = base.SendSonarrGet <DelayProfile>(base.FormatWithId(id)); return(foundProfile != null); }