Skip to content

Removing dependency on JsonApiDotNetCoreExample project in test projects #1068

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 1 commit into from
Sep 3, 2021
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Explain the problem and include additional details to help maintainers reproduce
This section guides you through submitting an enhancement suggestion, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.

Before creating enhancement suggestions:
- Check the [documentation](https://www.jsonapi.net/usage/resources/index.html) and [integration tests](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/test/JsonApiDotNetCoreExampleTests/IntegrationTests) for existing features. You might discover the enhancement is already available.
- Check the [documentation](https://www.jsonapi.net/usage/resources/index.html) and [integration tests](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/test/JsonApiDotNetCoreTests/IntegrationTests) for existing features. You might discover the enhancement is already available.
- Perform a search to see if the feature has already been reported. If it has and the issue is still open, add a comment to the existing issue instead of opening a new one.

When you are creating an enhancement suggestion, please include as many details as possible. Fill in the template, including the steps that you imagine you would take if the feature you're requesting existed.
Expand Down
2 changes: 1 addition & 1 deletion JsonApiDotNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GettingStarted", "src\Examples\GettingStarted\GettingStarted.csproj", "{067FFD7A-C66B-473D-8471-37F5C95DF61C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCoreExampleTests", "test\JsonApiDotNetCoreTests\JsonApiDotNetCoreExampleTests.csproj", "{CAF331F8-9255-4D72-A1A8-A54141E99F1E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCoreTests", "test\JsonApiDotNetCoreTests\JsonApiDotNetCoreTests.csproj", "{CAF331F8-9255-4D72-A1A8-A54141E99F1E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NoEntityFrameworkTests", "test\NoEntityFrameworkTests\NoEntityFrameworkTests.csproj", "{4F15A8F8-5BC6-45A1-BC51-03F921B726A4}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/writing/bulk-batch-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Content-Type: application/vnd.api+json;ext="https://jsonapi.org/ext/atomic"
}
```

For example requests, see our suite of tests in JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.
For example requests, see our suite of tests in JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.

## Configuration

Expand Down
24 changes: 0 additions & 24 deletions src/Examples/JsonApiDotNetCoreExample/Startups/EmptyStartup.cs

This file was deleted.

6 changes: 3 additions & 3 deletions src/Examples/JsonApiDotNetCoreExample/Startups/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace JsonApiDotNetCoreExample.Startups
{
public sealed class Startup : EmptyStartup
public sealed class Startup
{
private readonly ICodeTimerSession _codeTimingSession;
private readonly string _connectionString;
Expand All @@ -29,7 +29,7 @@ public Startup(IConfiguration configuration)
}

// This method gets called by the runtime. Use this method to add services to the container.
public override void ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
using (CodeTimingSessionManager.Current.Measure("Configure other (startup)"))
{
Expand Down Expand Up @@ -63,7 +63,7 @@ public override void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public override void Configure(IApplicationBuilder app, IWebHostEnvironment environment, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IWebHostEnvironment environment, ILoggerFactory loggerFactory)
{
ILogger<Startup> logger = loggerFactory.CreateLogger<Startup>();

Expand Down
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Benchmarks")]
[assembly: InternalsVisibleTo("JsonApiDotNetCoreExampleTests")]
[assembly: InternalsVisibleTo("JsonApiDotNetCoreTests")]
[assembly: InternalsVisibleTo("UnitTests")]
[assembly: InternalsVisibleTo("DiscoveryTests")]
[assembly: InternalsVisibleTo("TestBuildingBlocks")]
23 changes: 0 additions & 23 deletions test/JsonApiDotNetCoreTests/ExampleIntegrationTestContext.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
using FluentAssertions;
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExampleTests.Startups;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
public sealed class ArchiveTests : IClassFixture<ExampleIntegrationTestContext<TestableStartup<TelevisionDbContext>, TelevisionDbContext>>
public sealed class ArchiveTests : IClassFixture<IntegrationTestContext<TestableStartup<TelevisionDbContext>, TelevisionDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<TelevisionDbContext>, TelevisionDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<TelevisionDbContext>, TelevisionDbContext> _testContext;
private readonly TelevisionFakers _fakers = new();

public ArchiveTests(ExampleIntegrationTestContext<TestableStartup<TelevisionDbContext>, TelevisionDbContext> testContext)
public ArchiveTests(IntegrationTestContext<TestableStartup<TelevisionDbContext>, TelevisionDbContext> testContext)
{
_testContext = testContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public sealed class BroadcastComment : Identifiable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Services;
using Microsoft.Extensions.Logging;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
public sealed class BroadcastCommentsController : JsonApiController<BroadcastComment>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public sealed class TelevisionBroadcast : Identifiable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using JsonApiDotNetCore.Serialization.Objects;
using Microsoft.EntityFrameworkCore;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
public sealed class TelevisionBroadcastDefinition : JsonApiResourceDefinition<TelevisionBroadcast>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Services;
using Microsoft.Extensions.Logging;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
public sealed class TelevisionBroadcastsController : JsonApiController<TelevisionBroadcast>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public sealed class TelevisionDbContext : DbContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @formatter:wrap_chained_method_calls chop_always
// @formatter:keep_existing_linebreaks true

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
internal sealed class TelevisionFakers : FakerContainer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public sealed class TelevisionNetwork : Identifiable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Services;
using Microsoft.Extensions.Logging;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
public sealed class TelevisionNetworksController : JsonApiController<TelevisionNetwork>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public sealed class TelevisionStation : Identifiable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JsonApiDotNetCore.Services;
using Microsoft.Extensions.Logging;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
namespace JsonApiDotNetCoreTests.IntegrationTests.Archiving
{
public sealed class TelevisionStationsController : JsonApiController<TelevisionStation>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
using System.Threading.Tasks;
using FluentAssertions;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExampleTests.Startups;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Controllers
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Controllers
{
public sealed class AtomicConstrainedOperationsControllerTests
: IClassFixture<ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
: IClassFixture<IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly OperationsFakers _fakers = new();

public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
public AtomicConstrainedOperationsControllerTests(IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
{
_testContext = testContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Controllers
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Controllers
{
[DisableRoutingConvention]
[Route("/operations/musicTracks/create")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@
using FluentAssertions;
using FluentAssertions.Extensions;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExample.Controllers;
using JsonApiDotNetCoreExampleTests.Startups;
using Microsoft.EntityFrameworkCore;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Creating
{
public sealed class AtomicCreateResourceTests : IClassFixture<ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
public sealed class AtomicCreateResourceTests : IClassFixture<IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly OperationsFakers _fakers = new();

public AtomicCreateResourceTests(ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
public AtomicCreateResourceTests(IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
{
_testContext = testContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@
using FluentAssertions;
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExample.Controllers;
using JsonApiDotNetCoreExampleTests.Startups;
using Microsoft.Extensions.DependencyInjection;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Creating
{
public sealed class AtomicCreateResourceWithClientGeneratedIdTests
: IClassFixture<ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
: IClassFixture<IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly OperationsFakers _fakers = new();

public AtomicCreateResourceWithClientGeneratedIdTests(
ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
public AtomicCreateResourceWithClientGeneratedIdTests(IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
{
_testContext = testContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@
using System.Threading.Tasks;
using FluentAssertions;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExample.Controllers;
using JsonApiDotNetCoreExampleTests.Startups;
using Microsoft.EntityFrameworkCore;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Creating
{
public sealed class AtomicCreateResourceWithToManyRelationshipTests
: IClassFixture<ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
: IClassFixture<IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly OperationsFakers _fakers = new();

public AtomicCreateResourceWithToManyRelationshipTests(
ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
public AtomicCreateResourceWithToManyRelationshipTests(IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
{
_testContext = testContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@
using System.Threading.Tasks;
using FluentAssertions;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExample.Controllers;
using JsonApiDotNetCoreExampleTests.Startups;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Creating
{
public sealed class AtomicCreateResourceWithToOneRelationshipTests
: IClassFixture<ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
: IClassFixture<IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly OperationsFakers _fakers = new();

public AtomicCreateResourceWithToOneRelationshipTests(
ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
public AtomicCreateResourceWithToOneRelationshipTests(IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
{
_testContext = testContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@
using System.Threading.Tasks;
using FluentAssertions;
using JsonApiDotNetCore.Serialization.Objects;
using JsonApiDotNetCoreExample.Controllers;
using JsonApiDotNetCoreExampleTests.Startups;
using Microsoft.EntityFrameworkCore;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Deleting
namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.Deleting
{
public sealed class AtomicDeleteResourceTests : IClassFixture<ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
public sealed class AtomicDeleteResourceTests : IClassFixture<IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext>>
{
private readonly ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext;
private readonly OperationsFakers _fakers = new();

public AtomicDeleteResourceTests(ExampleIntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
public AtomicDeleteResourceTests(IntegrationTestContext<TestableStartup<OperationsDbContext>, OperationsDbContext> testContext)
{
_testContext = testContext;

Expand Down
Loading