Skip to content

Commit

Permalink
Update to dotnet7
Browse files Browse the repository at this point in the history
  • Loading branch information
willsbctm committed Mar 15, 2023
1 parent 8470644 commit 153542c
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="6.2.1" />
<PackageReference Include="FakeItEasy" Version="7.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="Moq" Version="4.18.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="33.0.1" />
<PackageReference Include="FakeItEasy" Version="6.2.1" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.5" />
<PackageReference Include="nunit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.4" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Net.Http;
using System.Threading.Tasks;
using DotNet.Core.Runtime.Faker;
using System.Net;

namespace DotNet.Core.Faker.Runtime.Integration.Tests
{
Expand Down Expand Up @@ -50,7 +51,7 @@ public async Task ShouldChangeClockImplementation()
serviceProvider.Change<Clock>(new MyClock());

var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using FakeItEasy;
using DotNet.Core.Runtime.Faker.FakeItEasy;
using DotNet.Core.Runtime.Faker;
using System.Net;

namespace DotNet.Core.Faker.Runtime.Integration.Tests
{
Expand Down Expand Up @@ -50,7 +51,7 @@ public void TearDown()
public async Task ShouldGetRegisteredValueForClock()
{
var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand All @@ -64,7 +65,7 @@ public async Task ShouldChangeClockImplementation()
serviceProvider.Change<Clock>(faker => A.CallTo(() => faker.Now()).Returns(now));

var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand All @@ -78,7 +79,7 @@ public async Task ShouldCleanChangesAndRestoreRegisteredValue()
serviceProvider.ResetAllChanges();

var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Threading.Tasks;
using DotNet.Core.Runtime.Faker;
using DotNet.Core.Runtime.Faker.Moq;
using System.Net;

namespace DotNet.Core.Faker.Runtime.Integration.Tests
{
Expand Down Expand Up @@ -49,7 +50,7 @@ public void TearDown()
public async Task ShouldGetRegisteredValueForClock()
{
var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand All @@ -63,7 +64,7 @@ public async Task ShouldChangeClockImplementation()
serviceProvider.Change<Clock>(mock => mock.Setup(x => x.Now()).Returns(now));

var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand All @@ -77,7 +78,7 @@ public async Task ShouldCleanChangesAndRestoreRegisteredValue()
serviceProvider.ResetAllChanges();

var result = await cliente.GetAsync("time");
result.StatusCode.Should().Be(200);
result.StatusCode.Should().Be(HttpStatusCode.OK);

var content = await result.Content.ReadAsStringAsync();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="nunit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>


Expand Down
36 changes: 18 additions & 18 deletions test/DotNet.Core.Runtime.Faker.WebApi.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using DotNet.Core.Runtime.Faker.WebApi.Sample;
using Microsoft.AspNetCore.Builder;

namespace DotNet.Core.Faker.Runtime.WebApi.Sample
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
var builder = WebApplication.CreateBuilder(args);

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
// Add services to the container.
builder.Services.AddTransient<Clock>();
builder.Services.AddControllers();

var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49232",
"sslPort": 44356
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "time",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"DotNet.Core.Faker.Runtime.WebApi.Sample": {
"commandName": "Project",
"launchBrowser": true,
Expand Down

0 comments on commit 153542c

Please sign in to comment.