Fixed unit tests

This commit is contained in:
Jamie Rees 2020-11-03 08:20:26 +00:00
commit 3aa28a58e5
3 changed files with 11 additions and 7 deletions

View file

@ -54,14 +54,15 @@ namespace Ombi.Core.Tests.Rule.Search
{ {
new EmbyServers new EmbyServers
{ {
ServerHostname = "http://test.com/" ServerHostname = "http://test.com/",
ServerId = "8"
} }
} }
}); });
ContextMock.Setup(x => x.GetByTheMovieDbId(It.IsAny<string>())).ReturnsAsync(new EmbyContent ContextMock.Setup(x => x.GetByTheMovieDbId(It.IsAny<string>())).ReturnsAsync(new EmbyContent
{ {
ProviderId = "123", ProviderId = "123",
EmbyId = 1.ToString() EmbyId = 1.ToString(),
}); });
var search = new SearchMovieViewModel() var search = new SearchMovieViewModel()
{ {
@ -70,7 +71,7 @@ namespace Ombi.Core.Tests.Rule.Search
var result = await Rule.Execute(search); var result = await Rule.Execute(search);
Assert.True(result.Success); 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] [Test]
@ -83,7 +84,8 @@ namespace Ombi.Core.Tests.Rule.Search
{ {
new EmbyServers 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); var result = await Rule.Execute(search);
Assert.True(result.Success); 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] [Test]

View file

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

View file

@ -23,7 +23,9 @@ namespace Ombi.Store.Context.Sqlite
Database.ExecuteSqlRaw(@"INSERT OR IGNORE INTO __EFMigrationsHistory (MigrationId,ProductVersion) Database.ExecuteSqlRaw(@"INSERT OR IGNORE INTO __EFMigrationsHistory (MigrationId,ProductVersion)
VALUES('20191103205204_Inital', '2.2.6-servicing-10079'); "); 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 // ignored
} }