Some unit tests, names and small fixes
This commit is contained in:
parent
23c4a451b4
commit
06914d1135
10 changed files with 332 additions and 13 deletions
48
API/Helpers/Builders/AppUserReadingProfileBuilder.cs
Normal file
48
API/Helpers/Builders/AppUserReadingProfileBuilder.cs
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue