Fixed unit tests

pull/3849/head
Jamie Rees 4 years ago
parent 53e502bd1c
commit 3aa28a58e5

@ -54,14 +54,15 @@ namespace Ombi.Core.Tests.Rule.Search
{
new EmbyServers
{
ServerHostname = "http://test.com/"
ServerHostname = "http://test.com/",
ServerId = "8"
}
}
});
ContextMock.Setup(x => x.GetByTheMovieDbId(It.IsAny<string>())).ReturnsAsync(new EmbyContent
{
ProviderId = "123",
EmbyId = 1.ToString()
EmbyId = 1.ToString(),
});
var search = new SearchMovieViewModel()
{
@ -70,7 +71,7 @@ namespace Ombi.Core.Tests.Rule.Search
var result = await Rule.Execute(search);
Assert.True(result.Success);
Assert.That(search.EmbyUrl, Is.EqualTo("http://test.com/#!/item?id=1"));
Assert.That(search.EmbyUrl, Is.EqualTo("http://test.com/web/index.html#!/item?id=1&serverId=8"));
}
[Test]
@ -83,7 +84,8 @@ namespace Ombi.Core.Tests.Rule.Search
{
new EmbyServers
{
ServerHostname = string.Empty
ServerHostname = string.Empty,
ServerId = "8"
}
}
});
@ -99,7 +101,7 @@ namespace Ombi.Core.Tests.Rule.Search
var result = await Rule.Execute(search);
Assert.True(result.Success);
Assert.That(search.EmbyUrl, Is.EqualTo("https://app.emby.media/#!/item?id=1"));
Assert.That(search.EmbyUrl, Is.EqualTo("https://app.emby.media/web/index.html#!/item?id=1&serverId=8"));
}
[Test]

@ -1,6 +1,6 @@
namespace Ombi.Helpers
{
public class EmbyHelper
public static class EmbyHelper
{
public static string GetEmbyMediaUrl(string mediaId, string serverId, string customerServerUrl = null, bool isJellyfin = false)
{

@ -23,7 +23,9 @@ namespace Ombi.Store.Context.Sqlite
Database.ExecuteSqlRaw(@"INSERT OR IGNORE INTO __EFMigrationsHistory (MigrationId,ProductVersion)
VALUES('20191103205204_Inital', '2.2.6-servicing-10079'); ");
}
catch (Exception)
#pragma warning disable RCS1075 // Avoid empty catch clause that catches System.Exception.
catch (Exception)
#pragma warning restore RCS1075 // Avoid empty catch clause that catches System.Exception.
{
// ignored
}

Loading…
Cancel
Save