public void CheckNoRequestLimitTest() { var settings = new PlexRequestSettings { AlbumWeeklyRequestLimit = 0, MovieWeeklyRequestLimit = 2, TvWeeklyRequestLimit = 0 }; var result = Search.CheckRequestLimit(settings, RequestType.Movie).Result; Assert.That(result, Is.True); RequestLimitRepo.Verify(x => x.GetAllAsync(), Times.Once); }
public bool CheckMovieLimitTest(int requestCount) { var users = F.CreateMany <RequestLimit>().ToList(); users.Add(new RequestLimit { Username = "", RequestCount = requestCount, RequestType = RequestType.Movie }); RequestLimitRepo.Setup(x => x.GetAllAsync()).ReturnsAsync(users); var settings = new PlexRequestSettings { AlbumWeeklyRequestLimit = 0, MovieWeeklyRequestLimit = 5, TvWeeklyRequestLimit = 0 }; var result = Search.CheckRequestLimit(settings, RequestType.Movie).Result; RequestLimitRepo.Verify(x => x.GetAllAsync(), Times.Once); return(result); }