mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
fixed #25
This commit is contained in:
parent
35b1f2b257
commit
f5cb4d6879
5 changed files with 97 additions and 5 deletions
|
@ -79,6 +79,27 @@ namespace PlexRequests.Services.Tests
|
|||
Assert.That(result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsAvailableDirectoryTitleTest()
|
||||
{
|
||||
var settingsMock = new Mock<ISettingsService<PlexSettings>>();
|
||||
var authMock = new Mock<ISettingsService<AuthenticationSettings>>();
|
||||
var requestMock = new Mock<IRequestService>();
|
||||
var plexMock = new Mock<IPlexApi>();
|
||||
|
||||
var searchResult = new PlexSearch { Directory = new Directory1 {Title = "title"} };
|
||||
|
||||
settingsMock.Setup(x => x.GetSettings()).Returns(new PlexSettings { Ip = "abc" });
|
||||
authMock.Setup(x => x.GetSettings()).Returns(new AuthenticationSettings { PlexAuthToken = "abc" });
|
||||
plexMock.Setup(x => x.SearchContent(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Uri>())).Returns(searchResult);
|
||||
|
||||
Checker = new PlexAvailabilityChecker(settingsMock.Object, authMock.Object, requestMock.Object, plexMock.Object);
|
||||
|
||||
var result = Checker.IsAvailable("title");
|
||||
|
||||
Assert.That(result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsNotAvailableTest()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue