-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PSP-9452: Split map search for PID PIN (#4480)
* Lint fixes, remove dead code * Split map search for PID PIN * Test updates * Update backend filter models * Update EF queries * Test updates * Support adding DB views to PIMS testing DB context * Test updates * Code cleanup * PR feedback * Add proxy microservice to "make infra" command
- Loading branch information
Showing
24 changed files
with
964 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Text.Json; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Options; | ||
using Pims.Dal; | ||
using Pims.Dal.Entities; | ||
|
||
namespace Pims.Core.Test | ||
{ | ||
/// <summary> | ||
/// PimsTestContext class, provides a data context to manage the datasource for the PIMS application (specific to UNIT TESTS). | ||
/// </summary> | ||
public class PimsTestContext : PimsContext | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PimsTestContext"/> class. | ||
/// </summary> | ||
public PimsTestContext() | ||
: base() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PimsTestContext"/> class. | ||
/// </summary> | ||
/// <param name="options">The options.</param> | ||
/// <param name="httpContextAccessor">Provides access to the current IHttpContextAccessor.HttpContext, if one is available.</param> | ||
/// <param name="serializerOptions">The serializer options.</param> | ||
public PimsTestContext(DbContextOptions<PimsContext> options, IHttpContextAccessor httpContextAccessor = null, IOptions<JsonSerializerOptions> serializerOptions = null) | ||
: base(options, httpContextAccessor, serializerOptions) | ||
{ | ||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
base.OnModelCreating(modelBuilder); | ||
|
||
// This is needed so unit tests for DB Views work with in-memory DB | ||
modelBuilder.Entity<PimsPropertyVw>(entity => | ||
{ | ||
entity.HasKey(x => x.PropertyId); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.