Skip to content

Commit

Permalink
remove FluentAssertions due to License changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Jan 16, 2025
1 parent e6c8170 commit 4f07fd5
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.sinks.Console" Version="6.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions samples/SampleStressTest/SampleStressTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/SampleWebApplication/SampleWebApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@

<ItemGroup>
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Azure.Data.Tables" Version="12.9.1" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Azure.Data.Tables" Version="12.10.0" />
<PackageReference Include="ulid" Version="1.3.4" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;

using FluentAssertions;

using Serilog.Sinks.AzureTableStorage.Extensions;

using Xunit;
Expand All @@ -25,7 +23,7 @@ public DateTimeExtensionsTests(ITestOutputHelper output)
public void GeneratePartitionKeyDateTimeNowRound(DateTime dateTime, DateTime expected, TimeSpan span)
{
var rounded = DateTimeExtensions.Round(dateTime, span);
rounded.Should().Be(expected);
Assert.Equal(expected, rounded);
}

public static IEnumerable<object[]> GetDateRounding()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;

using FluentAssertions;

using Serilog.Sinks.AzureTableStorage.Extensions;

using Xunit;
Expand All @@ -26,20 +24,20 @@ public void GenerateRowKeyDateTimeOffsetNow()
var dateTime = new DateTimeOffset(2024, 4, 1, 23, 0, 0, TimeSpan.FromHours(-5));

var rowKey = DefaultKeyGenerator.GenerateRowKey(dateTime);
rowKey.Should().NotBeNull();
Assert.NotNull(rowKey);

var parsed = Ulid.TryParse(rowKey, out var ulid);
parsed.Should().BeTrue();
ulid.Should().NotBeNull();
Assert.True(parsed);
Assert.NotEqual(default, ulid);

var reversed = dateTime.ToUniversalTime().ToReverseChronological();
var ulidDate = ulid.Time;

ulidDate.Year.Should().Be(reversed.Year);
ulidDate.Month.Should().Be(reversed.Month);
ulidDate.Day.Should().Be(reversed.Day);
ulidDate.Hour.Should().Be(reversed.Hour);
ulidDate.Minute.Should().Be(reversed.Minute);
Assert.Equal(reversed.Year, ulidDate.Year);
Assert.Equal(reversed.Month, ulidDate.Month);
Assert.Equal(reversed.Day, ulidDate.Day);
Assert.Equal(reversed.Hour, ulidDate.Hour);
Assert.Equal(reversed.Minute, ulidDate.Minute);
}


Expand All @@ -49,8 +47,8 @@ public void GeneratePartitionKeyDateTimeOffsetNow()
var dateTime = new DateTimeOffset(2024, 4, 1, 23, 0, 0, TimeSpan.FromHours(-5));

var partitionKey = DefaultKeyGenerator.GeneratePartitionKey(dateTime);
partitionKey.Should().NotBeNull();
partitionKey.Should().Be("2516902703999999999");
Assert.NotNull(partitionKey);
Assert.Equal("2516902703999999999", partitionKey);
}

[Fact]
Expand All @@ -60,17 +58,17 @@ public void GeneratePartitionKeyDateTimeNow()
var eventTime = dateTime.UtcDateTime;

var partitionKey = DefaultKeyGenerator.GeneratePartitionKey(eventTime);
partitionKey.Should().NotBeNull();
partitionKey.Should().Be("2516902703999999999");
Assert.NotNull(partitionKey);
Assert.Equal("2516902703999999999", partitionKey);
}

[Theory]
[MemberData(nameof(GetDateRounding))]
public void GeneratePartitionKeyDateTimeNowRound(DateTimeOffset dateTime, string expected)
{
var partitionKey = DefaultKeyGenerator.GeneratePartitionKey(dateTime);
partitionKey.Should().NotBeNull();
partitionKey.Should().Be(expected);
Assert.NotNull(partitionKey);
Assert.Equal(expected, partitionKey);
}

public static IEnumerable<object[]> GetDateRounding()
Expand Down Expand Up @@ -108,8 +106,8 @@ public void GeneratePartitionKeyQueryDateOnly()
var date = new DateOnly(2024, 4, 1);

var partitionKeyQuery = DefaultKeyGenerator.GeneratePartitionKeyQuery(date, TimeSpan.FromHours(-5));
partitionKeyQuery.Should().NotBeNull();
partitionKeyQuery.Should().Be("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')");
Assert.NotNull(partitionKeyQuery);
Assert.Equal("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')", partitionKeyQuery);
}

[Fact]
Expand All @@ -122,8 +120,8 @@ public void GeneratePartitionKeyQueryDateTime()
var endTime = endDate.UtcDateTime;

var partitionKeyQuery = DefaultKeyGenerator.GeneratePartitionKeyQuery(startTime, endTime);
partitionKeyQuery.Should().NotBeNull();
partitionKeyQuery.Should().Be("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')");
Assert.NotNull(partitionKeyQuery);
Assert.Equal("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')", partitionKeyQuery);
}

[Fact]
Expand All @@ -133,8 +131,8 @@ public void GeneratePartitionKeyQueryDateTimeOffset()
var endTime = new DateTimeOffset(2024, 4, 2, 0, 0, 0, TimeSpan.FromHours(-5));

var partitionKeyQuery = DefaultKeyGenerator.GeneratePartitionKeyQuery(startTime, endTime);
partitionKeyQuery.Should().NotBeNull();
partitionKeyQuery.Should().Be("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')");
Assert.NotNull(partitionKeyQuery);
Assert.Equal("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')", partitionKeyQuery);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit" Version="2.9.3" />
</ItemGroup>

</Project>

0 comments on commit 4f07fd5

Please sign in to comment.