mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Adding slugs tests for seasons
This commit is contained in:
parent
3ad5a0d127
commit
1bb29be134
@ -1,5 +1,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using Kyoo.Controllers;
|
||||
using Kyoo.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace Kyoo.Tests.SpecificTests
|
||||
{
|
||||
@ -11,5 +13,34 @@ namespace Kyoo.Tests.SpecificTests
|
||||
{
|
||||
_repository = Repositories.LibraryManager.SeasonRepository;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SlugEditTest()
|
||||
{
|
||||
Season season = await _repository.Get(1);
|
||||
Assert.Equal("anohana-s1", season.Slug);
|
||||
Show show = new()
|
||||
{
|
||||
ID = season.ShowID,
|
||||
Slug = "new-slug"
|
||||
};
|
||||
await Repositories.LibraryManager.ShowRepository.Edit(show, false);
|
||||
season = await _repository.Get(1);
|
||||
Assert.Equal("new-slug-s1", season.Slug);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SeasonNumberEditTest()
|
||||
{
|
||||
Season season = await _repository.Get(1);
|
||||
Assert.Equal("anohana-s1", season.Slug);
|
||||
season = await _repository.Edit(new Season
|
||||
{
|
||||
ID = 1,
|
||||
SeasonNumber = 2
|
||||
}, false);
|
||||
season = await _repository.Get(1);
|
||||
Assert.Equal("anohana-s2", season.Slug);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user