Skip to content

Package updates #1540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions package-versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@

<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
<BenchmarkDotNetVersion>0.13.*</BenchmarkDotNetVersion>
<BogusVersion>35.2.*</BogusVersion>
<BogusVersion>35.5.*</BogusVersion>
<CodeAnalysisVersion>4.9.*</CodeAnalysisVersion>
<CoverletVersion>6.0.*</CoverletVersion>
<DapperVersion>2.1.*</DapperVersion>
<FluentAssertionsVersion>6.12.*</FluentAssertionsVersion>
<GitHubActionsTestLoggerVersion>2.3.*</GitHubActionsTestLoggerVersion>
<InheritDocVersion>2.0.*</InheritDocVersion>
<SourceLinkVersion>8.0.*</SourceLinkVersion>
<TestSdkVersion>17.8.*</TestSdkVersion>
<XunitVersion>2.6.*</XunitVersion>
<XunitVisualStudioVersion>2.5.*</XunitVisualStudioVersion>
<TestSdkVersion>17.9.*</TestSdkVersion>
<XunitVersion>2.8.*</XunitVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
Expand All @@ -26,7 +25,7 @@

<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
<AspNetCoreVersion>8.0.*</AspNetCoreVersion>
<EntityFrameworkCoreVersion>8.0.*-*</EntityFrameworkCoreVersion>
<EntityFrameworkCoreVersion>8.0.*</EntityFrameworkCoreVersion>
<SystemTextJsonVersion>$(AspNetCoreVersion)</SystemTextJsonVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Examples/DapperExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// docker run --rm --detach --name dapper-example-postgresql-db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:latest
// docker run --rm --detach --name dapper-example-postgresql-management --link dapper-example-postgresql-db:db -e PGADMIN_DEFAULT_EMAIL=admin@admin.com -e PGADMIN_DEFAULT_PASSWORD=postgres -p 5050:80 dpage/pgadmin4:latest
"DapperExamplePostgreSql": "Host=localhost;Database=DapperExample;User ID=postgres;Password=postgres;Include Error Detail=true",
// docker run --rm --detach --name dapper-example-mysql-db -e MYSQL_ROOT_PASSWORD=mysql -e MYSQL_DATABASE=DapperExample -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -p 3306:3306 mysql:latest --default-authentication-plugin=mysql_native_password
// docker run --rm --detach --name dapper-example-mysql-db -e MYSQL_ROOT_PASSWORD=mysql -e MYSQL_DATABASE=DapperExample -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -p 3306:3306 mysql:latest
// docker run --rm --detach --name dapper-example-mysql-management --link dapper-example-mysql-db:db -p 8081:80 phpmyadmin/phpmyadmin
"DapperExampleMySql": "Host=localhost;Database=DapperExample;User ID=mysql;Password=mysql",
"DapperExampleMySql": "Host=localhost;Database=DapperExample;User ID=mysql;Password=mysql;SSL Mode=None;AllowPublicKeyRetrieval=True",
// docker run --rm --detach --name dapper-example-sqlserver -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Passw0rd!" -p 1433:1433 mcr.microsoft.com/mssql/server:2022-latest
"DapperExampleSqlServer": "Server=localhost;Database=DapperExample;User ID=sa;Password=Passw0rd!;TrustServerCertificate=true"
},
Expand Down
2 changes: 1 addition & 1 deletion test/DapperTests/IntegrationTests/DapperTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private WebApplicationFactory<TodoItem> CreateFactory()
$"Host=localhost;Database=DapperExample-{Guid.NewGuid():N};User ID=postgres;Password=postgres;Include Error Detail=true");

builder.UseSetting("ConnectionStrings:DapperExampleMySql",
$"Host=localhost;Database=DapperExample-{Guid.NewGuid():N};User ID=root;Password=mysql;SSL Mode=None");
$"Host=localhost;Database=DapperExample-{Guid.NewGuid():N};User ID=root;Password=mysql;SSL Mode=None;AllowPublicKeyRetrieval=True");

builder.UseSetting("ConnectionStrings:DapperExampleSqlServer",
$"Server=localhost;Database=DapperExample-{Guid.NewGuid():N};User ID=sa;Password=Passw0rd!;TrustServerCertificate=true");
Expand Down
6 changes: 2 additions & 4 deletions test/DapperTests/IntegrationTests/FrozenClock.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using DapperExample;
using FluentAssertions.Extensions;
using JetBrains.Annotations;
using TestBuildingBlocks;

namespace DapperTests.IntegrationTests;

[UsedImplicitly(ImplicitUseTargetFlags.Members)]
internal sealed class FrozenClock : IClock
{
private static readonly DateTimeOffset DefaultTime = 1.January(2020).At(1, 1, 1).AsUtc();

public DateTimeOffset UtcNow { get; set; } = DefaultTime;
public DateTimeOffset UtcNow { get; set; } = FrozenSystemClock.DefaultDateTimeOffsetUtc;
}
14 changes: 7 additions & 7 deletions test/DapperTests/IntegrationTests/TestFakers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

namespace DapperTests.IntegrationTests;

internal sealed class TestFakers : FakerContainer
internal sealed class TestFakers
{
private readonly Lazy<Faker<TodoItem>> _lazyTodoItemFaker = new(() =>
new Faker<TodoItem>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(todoItem => todoItem.Description, faker => faker.Lorem.Sentence())
.RuleFor(todoItem => todoItem.Priority, faker => faker.Random.Enum<TodoItemPriority>())
.RuleFor(todoItem => todoItem.DurationInHours, faker => faker.Random.Long(1, 250))
Expand All @@ -24,31 +24,31 @@ internal sealed class TestFakers : FakerContainer

private readonly Lazy<Faker<LoginAccount>> _lazyLoginAccountFaker = new(() =>
new Faker<LoginAccount>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(loginAccount => loginAccount.UserName, faker => faker.Internet.UserName())
.RuleFor(loginAccount => loginAccount.LastUsedAt, faker => faker.Date.PastOffset()
.TruncateToWholeMilliseconds()));

private readonly Lazy<Faker<AccountRecovery>> _lazyAccountRecoveryFaker = new(() =>
new Faker<AccountRecovery>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(accountRecovery => accountRecovery.PhoneNumber, faker => faker.Person.Phone)
.RuleFor(accountRecovery => accountRecovery.EmailAddress, faker => faker.Person.Email));

private readonly Lazy<Faker<Person>> _lazyPersonFaker = new(() =>
new Faker<Person>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(person => person.FirstName, faker => faker.Name.FirstName())
.RuleFor(person => person.LastName, faker => faker.Name.LastName()));

private readonly Lazy<Faker<Tag>> _lazyTagFaker = new(() =>
new Faker<Tag>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(tag => tag.Name, faker => faker.Lorem.Word()));

private readonly Lazy<Faker<RgbColorType>> _lazyRgbColorFaker = new(() =>
new Faker<RgbColorType>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(rgbColor => rgbColor.Id, faker => RgbColorType.Create(faker.Random.Byte(), faker.Random.Byte(), faker.Random.Byte())
.Id));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving;

internal sealed class TelevisionFakers : FakerContainer
internal sealed class TelevisionFakers
{
private readonly Lazy<Faker<TelevisionNetwork>> _lazyTelevisionNetworkFaker = new(() => new Faker<TelevisionNetwork>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(network => network.Name, faker => faker.Company.CompanyName()));

private readonly Lazy<Faker<TelevisionStation>> _lazyTelevisionStationFaker = new(() => new Faker<TelevisionStation>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(station => station.Name, faker => faker.Company.CompanyName()));

private readonly Lazy<Faker<TelevisionBroadcast>> _lazyTelevisionBroadcastFaker = new(() => new Faker<TelevisionBroadcast>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(broadcast => broadcast.Title, faker => faker.Lorem.Sentence())
.RuleFor(broadcast => broadcast.AiredAt, faker => faker.Date.PastOffset().TruncateToWholeMilliseconds())
.RuleFor(broadcast => broadcast.ArchivedAt, faker => faker.Date.RecentOffset().TruncateToWholeMilliseconds()));

private readonly Lazy<Faker<BroadcastComment>> _lazyBroadcastCommentFaker = new(() => new Faker<BroadcastComment>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(comment => comment.Text, faker => faker.Lorem.Paragraph())
.RuleFor(comment => comment.CreatedAt, faker => faker.Date.PastOffset().TruncateToWholeMilliseconds()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations;

internal sealed class OperationsFakers : FakerContainer
internal sealed class OperationsFakers
{
private static readonly Lazy<IReadOnlyList<string>> LazyLanguageIsoCodes = new(() => CultureInfo
.GetCultures(CultureTypes.NeutralCultures)
Expand All @@ -16,32 +16,32 @@ internal sealed class OperationsFakers : FakerContainer
.ToArray());

private readonly Lazy<Faker<Playlist>> _lazyPlaylistFaker = new(() => new Faker<Playlist>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(playlist => playlist.Name, faker => faker.Lorem.Sentence()));

private readonly Lazy<Faker<MusicTrack>> _lazyMusicTrackFaker = new(() => new Faker<MusicTrack>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(musicTrack => musicTrack.Title, faker => faker.Lorem.Word())
.RuleFor(musicTrack => musicTrack.LengthInSeconds, faker => faker.Random.Decimal(3 * 60, 5 * 60))
.RuleFor(musicTrack => musicTrack.Genre, faker => faker.Lorem.Word())
.RuleFor(musicTrack => musicTrack.ReleasedAt, faker => faker.Date.PastOffset().TruncateToWholeMilliseconds()));

private readonly Lazy<Faker<Lyric>> _lazyLyricFaker = new(() => new Faker<Lyric>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(lyric => lyric.Text, faker => faker.Lorem.Text())
.RuleFor(lyric => lyric.Format, "LRC"));

private readonly Lazy<Faker<TextLanguage>> _lazyTextLanguageFaker = new(() => new Faker<TextLanguage>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(textLanguage => textLanguage.IsoCode, faker => faker.PickRandom<string>(LazyLanguageIsoCodes.Value)));

private readonly Lazy<Faker<Performer>> _lazyPerformerFaker = new(() => new Faker<Performer>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(performer => performer.ArtistName, faker => faker.Name.FullName())
.RuleFor(performer => performer.BornAt, faker => faker.Date.PastOffset().TruncateToWholeMilliseconds()));

private readonly Lazy<Faker<RecordCompany>> _lazyRecordCompanyFaker = new(() => new Faker<RecordCompany>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(recordCompany => recordCompany.Name, faker => faker.Company.CompanyName())
.RuleFor(recordCompany => recordCompany.CountryOfResidence, faker => faker.Address.Country()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.Authorization.Scopes;

internal sealed class ScopesFakers : FakerContainer
internal sealed class ScopesFakers
{
private readonly Lazy<Faker<Movie>> _lazyMovieFaker = new(() => new Faker<Movie>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(movie => movie.Title, faker => faker.Random.Words())
.RuleFor(movie => movie.ReleaseYear, faker => faker.Random.Int(1900, 2050))
.RuleFor(movie => movie.DurationInSeconds, faker => faker.Random.Int(300, 14400)));

private readonly Lazy<Faker<Actor>> _lazyActorFaker = new(() => new Faker<Actor>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(actor => actor.Name, faker => faker.Person.FullName)
.RuleFor(actor => actor.BornAt, faker => faker.Date.Past()));

private readonly Lazy<Faker<Genre>> _lazyGenreFaker = new(() => new Faker<Genre>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(genre => genre.Name, faker => faker.Random.Word()));

public Faker<Movie> Movie => _lazyMovieFaker.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.Blobs;

internal sealed class BlobFakers : FakerContainer
internal sealed class BlobFakers
{
private readonly Lazy<Faker<ImageContainer>> _lazyImageContainerFaker = new(() => new Faker<ImageContainer>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(imageContainer => imageContainer.FileName, faker => faker.System.FileName())
.RuleFor(imageContainer => imageContainer.Data, faker => faker.Random.Bytes(128))
.RuleFor(imageContainer => imageContainer.Thumbnail, faker => faker.Random.Bytes(64)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.CompositeKeys;

internal sealed class CompositeKeyFakers : FakerContainer
internal sealed class CompositeKeyFakers
{
private readonly Lazy<Faker<Car>> _lazyCarFaker = new(() => new Faker<Car>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(car => car.LicensePlate, faker => faker.Random.Replace("??-??-##"))
.RuleFor(car => car.RegionId, faker => faker.Random.Long(100, 999)));

private readonly Lazy<Faker<Engine>> _lazyEngineFaker = new(() => new Faker<Engine>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(engine => engine.SerialCode, faker => faker.Random.Replace("????-????")));

private readonly Lazy<Faker<Dealership>> _lazyDealershipFaker = new(() => new Faker<Dealership>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(dealership => dealership.Address, faker => faker.Address.FullAddress()));

public Faker<Car> Car => _lazyCarFaker.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.CustomRoutes;

internal sealed class CustomRouteFakers : FakerContainer
internal sealed class CustomRouteFakers
{
private readonly Lazy<Faker<Town>> _lazyTownFaker = new(() => new Faker<Town>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(town => town.Name, faker => faker.Address.City())
.RuleFor(town => town.Latitude, faker => faker.Address.Latitude())
.RuleFor(town => town.Longitude, faker => faker.Address.Longitude()));

private readonly Lazy<Faker<Civilian>> _lazyCivilianFaker = new(() => new Faker<Civilian>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(civilian => civilian.Name, faker => faker.Person.FullName));

public Faker<Town> Town => _lazyTownFaker.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.EagerLoading;

internal sealed class EagerLoadingFakers : FakerContainer
internal sealed class EagerLoadingFakers
{
private readonly Lazy<Faker<State>> _lazyStateFaker = new(() => new Faker<State>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(state => state.Name, faker => faker.Address.City()));

private readonly Lazy<Faker<City>> _lazyCityFaker = new(() => new Faker<City>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(city => city.Name, faker => faker.Address.City()));

private readonly Lazy<Faker<Street>> _lazyStreetFaker = new(() => new Faker<Street>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(street => street.Name, faker => faker.Address.StreetName()));

private readonly Lazy<Faker<Building>> _lazyBuildingFaker = new(() => new Faker<Building>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(building => building.Number, faker => faker.Address.BuildingNumber()));

private readonly Lazy<Faker<Window>> _lazyWindowFaker = new(() => new Faker<Window>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(window => window.HeightInCentimeters, faker => faker.Random.Number(30, 199))
.RuleFor(window => window.WidthInCentimeters, faker => faker.Random.Number(30, 199)));

private readonly Lazy<Faker<Door>> _lazyDoorFaker = new(() => new Faker<Door>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(door => door.Color, faker => faker.Commerce.Color()));

public Faker<State> State => _lazyStateFaker.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.HostingInIIS;

internal sealed class HostingFakers : FakerContainer
internal sealed class HostingFakers
{
private readonly Lazy<Faker<ArtGallery>> _lazyArtGalleryFaker = new(() => new Faker<ArtGallery>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(artGallery => artGallery.Theme, faker => faker.Lorem.Word()));

private readonly Lazy<Faker<Painting>> _lazyPaintingFaker = new(() => new Faker<Painting>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(painting => painting.Title, faker => faker.Lorem.Sentence()));

public Faker<ArtGallery> ArtGallery => _lazyArtGalleryFaker.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.IdObfuscation;

internal sealed class ObfuscationFakers : FakerContainer
internal sealed class ObfuscationFakers
{
private readonly Lazy<Faker<BankAccount>> _lazyBankAccountFaker = new(() => new Faker<BankAccount>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(bankAccount => bankAccount.Iban, faker => faker.Finance.Iban()));

private readonly Lazy<Faker<DebitCard>> _lazyDebitCardFaker = new(() => new Faker<DebitCard>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(debitCard => debitCard.OwnerName, faker => faker.Name.FullName())
.RuleFor(debitCard => debitCard.PinCode, faker => (short)faker.Random.Number(1000, 9999)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace JsonApiDotNetCoreTests.IntegrationTests.InputValidation.ModelState;

internal sealed class ModelStateFakers : FakerContainer
internal sealed class ModelStateFakers
{
private static readonly DateOnly MinCreatedOn = DateOnly.Parse("2000-01-01", CultureInfo.InvariantCulture);
private static readonly DateOnly MaxCreatedOn = DateOnly.Parse("2050-01-01", CultureInfo.InvariantCulture);
Expand All @@ -16,19 +16,19 @@ internal sealed class ModelStateFakers : FakerContainer
private static readonly TimeOnly MaxCreatedAt = TimeOnly.Parse("17:30:00", CultureInfo.InvariantCulture);

private readonly Lazy<Faker<SystemVolume>> _lazySystemVolumeFaker = new(() => new Faker<SystemVolume>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(systemVolume => systemVolume.Name, faker => faker.Lorem.Word()));

private readonly Lazy<Faker<SystemFile>> _lazySystemFileFaker = new(() => new Faker<SystemFile>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(systemFile => systemFile.FileName, faker => faker.System.FileName())
.RuleFor(systemFile => systemFile.Attributes, faker => faker.Random.Enum(FileAttributes.Normal, FileAttributes.Hidden, FileAttributes.ReadOnly))
.RuleFor(systemFile => systemFile.SizeInBytes, faker => faker.Random.Long(0, 1_000_000))
.RuleFor(systemFile => systemFile.CreatedOn, faker => faker.Date.BetweenDateOnly(MinCreatedOn, MaxCreatedOn))
.RuleFor(systemFile => systemFile.CreatedAt, faker => faker.Date.BetweenTimeOnly(MinCreatedAt, MaxCreatedAt)));

private readonly Lazy<Faker<SystemDirectory>> _lazySystemDirectoryFaker = new(() => new Faker<SystemDirectory>()
.UseSeed(GetFakerSeed())
.MakeDeterministic()
.RuleFor(systemDirectory => systemDirectory.Name, faker => Path.GetFileNameWithoutExtension(faker.System.FileName()))
.RuleFor(systemDirectory => systemDirectory.IsCaseSensitive, faker => faker.Random.Bool()));

Expand Down
Loading