Some unit tests, names and small fixes

This commit is contained in:
Amelia 2025-05-15 23:58:42 +02:00
parent 23c4a451b4
commit 06914d1135
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
10 changed files with 332 additions and 13 deletions

View file

@ -0,0 +1,48 @@
using API.Entities;
using API.Extensions;
namespace API.Helpers.Builders;
public class AppUserReadingProfileBuilder
{
private readonly AppUserReadingProfile _profile;
public AppUserReadingProfile Build() => _profile;
public AppUserReadingProfileBuilder(int userId)
{
_profile = new AppUserReadingProfile
{
UserId = userId,
Series = [],
Libraries = [],
};
}
public AppUserReadingProfileBuilder WithSeries(Series series)
{
_profile.Series.Add(series);
return this;
}
public AppUserReadingProfileBuilder WithLibrary(Library library)
{
_profile.Libraries.Add(library);
return this;
}
public AppUserReadingProfileBuilder WithImplicit(bool b)
{
_profile.Implicit = b;
return this;
}
public AppUserReadingProfileBuilder WithName(string name)
{
_profile.Name = name;
_profile.NormalizedName = name.ToNormalized();
return this;
}
}