Skip to content

Commit 12b076d

Browse files
Test Bump
1 parent 4cacc95 commit 12b076d

File tree

212 files changed

+2751
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+2751
-159
lines changed

Tests/AdvancedMapping.Repositories.Mapperly.Tests/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<module moduleId="Intent.Application.Contracts" version="5.1.1" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
44
<module moduleId="Intent.Application.DependencyInjection" version="4.1.11-pre.0" supportedClientVersions="[4.5.15-a, 5.0.0-a)" />
55
<module moduleId="Intent.Application.DependencyInjection.MediatR" version="3.6.0" supportedClientVersions="[4.0.3-pre.6, 5.0.0-a)" />
6-
<module moduleId="Intent.Application.DomainInteractions" version="1.1.6" supportedClientVersions="[4.5.15-a,5.0.0)" />
6+
<module moduleId="Intent.Application.DomainInteractions" version="1.1.7-pre.0" supportedClientVersions="[4.5.15-a,5.0.0)" />
77
<module moduleId="Intent.Application.Dtos" version="4.4.6" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
88
<module moduleId="Intent.Application.Dtos.Mapperly" version="1.0.0" supportedClientVersions="[4.5.18-a,5.0.0)" />
99
<module moduleId="Intent.Application.Dtos.Pagination" version="4.1.2" supportedClientVersions="[4.3.0-a, 5.0.0-a)" />

Tests/AdvancedMappingCrud.Cosmos.Tests/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<module moduleId="Intent.Application.DependencyInjection" version="4.1.11-pre.0" supportedClientVersions="[4.5.15-a, 5.0.0-a)" />
66
<module moduleId="Intent.Application.DependencyInjection.AutoMapper" version="4.0.3" supportedClientVersions="[4.1.0-pre.0, 5.0.0-a)" />
77
<module moduleId="Intent.Application.DependencyInjection.MediatR" version="3.6.0" supportedClientVersions="[4.0.3-pre.6, 5.0.0-a)" />
8-
<module moduleId="Intent.Application.DomainInteractions" version="1.1.6" supportedClientVersions="[4.5.15-a,5.0.0)" />
8+
<module moduleId="Intent.Application.DomainInteractions" version="1.1.7-pre.0" supportedClientVersions="[4.5.15-a,5.0.0)" />
99
<module moduleId="Intent.Application.Dtos" version="4.4.6" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1010
<module moduleId="Intent.Application.Dtos.AutoMapper" version="4.0.18" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1111
<module moduleId="Intent.Application.Dtos.Pagination" version="4.1.2" supportedClientVersions="[4.3.0-a, 5.0.0-a)" />

Tests/AdvancedMappingCrud.DbContext.ProjectTo.Tests/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<module moduleId="Intent.Application.DependencyInjection" version="4.1.11-pre.0" supportedClientVersions="[4.5.15-a, 5.0.0-a)" />
66
<module moduleId="Intent.Application.DependencyInjection.AutoMapper" version="4.0.3" supportedClientVersions="[4.1.0-pre.0, 5.0.0-a)" />
77
<module moduleId="Intent.Application.DependencyInjection.MediatR" version="3.6.0" supportedClientVersions="[4.0.3-pre.6, 5.0.0-a)" />
8-
<module moduleId="Intent.Application.DomainInteractions" version="1.1.6" supportedClientVersions="[4.5.15-a,5.0.0)" />
8+
<module moduleId="Intent.Application.DomainInteractions" version="1.1.7-pre.0" supportedClientVersions="[4.5.15-a,5.0.0)" />
99
<module moduleId="Intent.Application.Dtos" version="4.4.6" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1010
<module moduleId="Intent.Application.Dtos.AutoMapper" version="4.0.18" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1111
<module moduleId="Intent.Application.Dtos.Pagination" version="4.1.2" supportedClientVersions="[4.3.0-a, 5.0.0-a)" />

Tests/AdvancedMappingCrud.DbContext.Tests/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<module moduleId="Intent.Application.DependencyInjection" version="4.1.11-pre.0" supportedClientVersions="[4.5.15-a, 5.0.0-a)" />
66
<module moduleId="Intent.Application.DependencyInjection.AutoMapper" version="4.0.3" supportedClientVersions="[4.1.0-pre.0, 5.0.0-a)" />
77
<module moduleId="Intent.Application.DependencyInjection.MediatR" version="3.6.0" supportedClientVersions="[4.0.3-pre.6, 5.0.0-a)" />
8-
<module moduleId="Intent.Application.DomainInteractions" version="1.1.6" supportedClientVersions="[4.5.15-a,5.0.0)" />
8+
<module moduleId="Intent.Application.DomainInteractions" version="1.1.7-pre.0" supportedClientVersions="[4.5.15-a,5.0.0)" />
99
<module moduleId="Intent.Application.Dtos" version="4.4.6" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1010
<module moduleId="Intent.Application.Dtos.AutoMapper" version="4.0.18" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1111
<module moduleId="Intent.Application.Dtos.Pagination" version="4.1.2" supportedClientVersions="[4.3.0-a, 5.0.0-a)" />

Tests/AdvancedMappingCrud.Mongo.Tests/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<module moduleId="Intent.Application.DependencyInjection" version="4.1.11-pre.0" supportedClientVersions="[4.5.15-a, 5.0.0-a)" />
66
<module moduleId="Intent.Application.DependencyInjection.AutoMapper" version="4.0.3" supportedClientVersions="[4.1.0-pre.0, 5.0.0-a)" />
77
<module moduleId="Intent.Application.DependencyInjection.MediatR" version="3.6.0" supportedClientVersions="[4.0.3-pre.6, 5.0.0-a)" />
8-
<module moduleId="Intent.Application.DomainInteractions" version="1.1.6" supportedClientVersions="[4.5.15-a,5.0.0)" />
8+
<module moduleId="Intent.Application.DomainInteractions" version="1.1.7-pre.0" supportedClientVersions="[4.5.15-a,5.0.0)" />
99
<module moduleId="Intent.Application.Dtos" version="4.4.6" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1010
<module moduleId="Intent.Application.Dtos.AutoMapper" version="4.0.18" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1111
<module moduleId="Intent.Application.Dtos.Pagination" version="4.1.2" supportedClientVersions="[4.3.0-a, 5.0.0-a)" />

Tests/AdvancedMappingCrud.Repositories.ProjectTo.Tests/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<module moduleId="Intent.Application.DependencyInjection" version="4.1.11-pre.0" supportedClientVersions="[4.5.15-a, 5.0.0-a)" />
66
<module moduleId="Intent.Application.DependencyInjection.AutoMapper" version="4.0.3" supportedClientVersions="[4.1.0-pre.0, 5.0.0-a)" />
77
<module moduleId="Intent.Application.DependencyInjection.MediatR" version="3.6.0" supportedClientVersions="[4.0.3-pre.6, 5.0.0-a)" />
8-
<module moduleId="Intent.Application.DomainInteractions" version="1.1.6" supportedClientVersions="[4.5.15-a,5.0.0)" />
8+
<module moduleId="Intent.Application.DomainInteractions" version="1.1.7-pre.0" supportedClientVersions="[4.5.15-a,5.0.0)" />
99
<module moduleId="Intent.Application.Dtos" version="4.4.6" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1010
<module moduleId="Intent.Application.Dtos.AutoMapper" version="4.0.18" supportedClientVersions="[4.5.0-a, 5.0.0-a)" />
1111
<module moduleId="Intent.Application.Dtos.Pagination" version="4.1.2" supportedClientVersions="[4.3.0-a, 5.0.0-a)" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Net.Mime;
4+
using System.Threading;
5+
using System.Threading.Tasks;
6+
using AdvancedMappingCrud.Repositories.Tests.Api.Controllers.ResponseTypes;
7+
using AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds;
8+
using AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.CreateDBAssigned;
9+
using AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.DeleteDBAssigned;
10+
using AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.GetDBAssignedById;
11+
using AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.GetDBAssigneds;
12+
using AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.UpdateDBAssigned;
13+
using Intent.RoslynWeaver.Attributes;
14+
using MediatR;
15+
using Microsoft.AspNetCore.Authorization;
16+
using Microsoft.AspNetCore.Http;
17+
using Microsoft.AspNetCore.Mvc;
18+
using Microsoft.Extensions.DependencyInjection;
19+
20+
[assembly: DefaultIntentManaged(Mode.Fully)]
21+
[assembly: DefaultIntentManaged(Mode.Fully, Targets = Targets.Usings)]
22+
[assembly: IntentTemplate("Intent.AspNetCore.Controllers.Controller", Version = "1.0")]
23+
24+
namespace AdvancedMappingCrud.Repositories.Tests.Api.Controllers
25+
{
26+
[ApiController]
27+
public class DBAssignedsController : ControllerBase
28+
{
29+
private readonly ISender _mediator;
30+
31+
public DBAssignedsController(ISender mediator)
32+
{
33+
_mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
34+
}
35+
36+
/// <summary>
37+
/// </summary>
38+
/// <response code="201">Successfully created.</response>
39+
/// <response code="400">One or more validation errors have occurred.</response>
40+
[HttpPost("api/d-b-assigneds")]
41+
[Produces(MediaTypeNames.Application.Json)]
42+
[ProducesResponseType(typeof(JsonResponse<Guid>), StatusCodes.Status201Created)]
43+
[ProducesResponseType(StatusCodes.Status400BadRequest)]
44+
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
45+
public async Task<ActionResult<JsonResponse<Guid>>> CreateDBAssigned(
46+
[FromBody] CreateDBAssignedCommand command,
47+
CancellationToken cancellationToken = default)
48+
{
49+
var result = await _mediator.Send(command, cancellationToken);
50+
return CreatedAtAction(nameof(GetDBAssignedById), new { id = result }, new JsonResponse<Guid>(result));
51+
}
52+
53+
/// <summary>
54+
/// </summary>
55+
/// <response code="200">Successfully deleted.</response>
56+
/// <response code="400">One or more validation errors have occurred.</response>
57+
/// <response code="404">One or more entities could not be found with the provided parameters.</response>
58+
[HttpDelete("api/d-b-assigneds/{id}")]
59+
[ProducesResponseType(StatusCodes.Status200OK)]
60+
[ProducesResponseType(StatusCodes.Status400BadRequest)]
61+
[ProducesResponseType(StatusCodes.Status404NotFound)]
62+
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
63+
public async Task<ActionResult> DeleteDBAssigned(
64+
[FromRoute] Guid id,
65+
CancellationToken cancellationToken = default)
66+
{
67+
await _mediator.Send(new DeleteDBAssignedCommand(id: id), cancellationToken);
68+
return Ok();
69+
}
70+
71+
/// <summary>
72+
/// </summary>
73+
/// <response code="204">Successfully updated.</response>
74+
/// <response code="400">One or more validation errors have occurred.</response>
75+
/// <response code="404">One or more entities could not be found with the provided parameters.</response>
76+
[HttpPut("api/d-b-assigneds/{id}")]
77+
[ProducesResponseType(StatusCodes.Status204NoContent)]
78+
[ProducesResponseType(StatusCodes.Status400BadRequest)]
79+
[ProducesResponseType(StatusCodes.Status404NotFound)]
80+
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
81+
public async Task<ActionResult> UpdateDBAssigned(
82+
[FromRoute] Guid id,
83+
[FromBody] UpdateDBAssignedCommand command,
84+
CancellationToken cancellationToken = default)
85+
{
86+
if (command.Id == Guid.Empty)
87+
{
88+
command.Id = id;
89+
}
90+
91+
if (id != command.Id)
92+
{
93+
return BadRequest();
94+
}
95+
96+
await _mediator.Send(command, cancellationToken);
97+
return NoContent();
98+
}
99+
100+
/// <summary>
101+
/// </summary>
102+
/// <response code="200">Returns the specified DBAssignedDto.</response>
103+
/// <response code="400">One or more validation errors have occurred.</response>
104+
/// <response code="404">No DBAssignedDto could be found with the provided parameters.</response>
105+
[HttpGet("api/d-b-assigneds/{id}")]
106+
[ProducesResponseType(typeof(DBAssignedDto), StatusCodes.Status200OK)]
107+
[ProducesResponseType(StatusCodes.Status400BadRequest)]
108+
[ProducesResponseType(StatusCodes.Status404NotFound)]
109+
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
110+
public async Task<ActionResult<DBAssignedDto>> GetDBAssignedById(
111+
[FromRoute] Guid id,
112+
CancellationToken cancellationToken = default)
113+
{
114+
var result = await _mediator.Send(new GetDBAssignedByIdQuery(id: id), cancellationToken);
115+
return result == null ? NotFound() : Ok(result);
116+
}
117+
118+
/// <summary>
119+
/// </summary>
120+
/// <response code="200">Returns the specified List&lt;DBAssignedDto&gt;.</response>
121+
[HttpGet("api/d-b-assigneds")]
122+
[ProducesResponseType(typeof(List<DBAssignedDto>), StatusCodes.Status200OK)]
123+
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
124+
public async Task<ActionResult<List<DBAssignedDto>>> GetDBAssigneds(CancellationToken cancellationToken = default)
125+
{
126+
var result = await _mediator.Send(new GetDBAssignedsQuery(), cancellationToken);
127+
return Ok(result);
128+
}
129+
}
130+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using AdvancedMappingCrud.Repositories.Tests.Application.Common.Interfaces;
3+
using Intent.RoslynWeaver.Attributes;
4+
using MediatR;
5+
6+
[assembly: DefaultIntentManaged(Mode.Fully)]
7+
[assembly: IntentTemplate("Intent.Application.MediatR.CommandModels", Version = "1.0")]
8+
9+
namespace AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.CreateDBAssigned
10+
{
11+
public class CreateDBAssignedCommand : IRequest<Guid>, ICommand
12+
{
13+
public CreateDBAssignedCommand(string name)
14+
{
15+
Name = name;
16+
}
17+
18+
public string Name { get; set; }
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Threading;
3+
using System.Threading.Tasks;
4+
using AdvancedMappingCrud.Repositories.Tests.Domain.Entities.ExplicitAutoGenerated;
5+
using AdvancedMappingCrud.Repositories.Tests.Domain.Repositories.ExplicitAutoGenerated;
6+
using Intent.RoslynWeaver.Attributes;
7+
using MediatR;
8+
9+
[assembly: DefaultIntentManaged(Mode.Fully)]
10+
[assembly: IntentTemplate("Intent.Application.MediatR.CommandHandler", Version = "2.0")]
11+
12+
namespace AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.CreateDBAssigned
13+
{
14+
[IntentManaged(Mode.Merge, Signature = Mode.Fully)]
15+
public class CreateDBAssignedCommandHandler : IRequestHandler<CreateDBAssignedCommand, Guid>
16+
{
17+
private readonly IDBAssignedRepository _dBAssignedRepository;
18+
19+
[IntentManaged(Mode.Merge)]
20+
public CreateDBAssignedCommandHandler(IDBAssignedRepository dBAssignedRepository)
21+
{
22+
_dBAssignedRepository = dBAssignedRepository;
23+
}
24+
25+
[IntentManaged(Mode.Fully, Body = Mode.Fully)]
26+
public async Task<Guid> Handle(CreateDBAssignedCommand request, CancellationToken cancellationToken)
27+
{
28+
var dBAssigned = new DBAssigned
29+
{
30+
Name = request.Name
31+
};
32+
33+
_dBAssignedRepository.Add(dBAssigned);
34+
await _dBAssignedRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
35+
return dBAssigned.Id;
36+
}
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using FluentValidation;
2+
using Intent.RoslynWeaver.Attributes;
3+
4+
[assembly: DefaultIntentManaged(Mode.Fully)]
5+
[assembly: IntentTemplate("Intent.Application.MediatR.FluentValidation.CommandValidator", Version = "2.0")]
6+
7+
namespace AdvancedMappingCrud.Repositories.Tests.Application.DBAssigneds.CreateDBAssigned
8+
{
9+
[IntentManaged(Mode.Fully, Body = Mode.Merge)]
10+
public class CreateDBAssignedCommandValidator : AbstractValidator<CreateDBAssignedCommand>
11+
{
12+
[IntentManaged(Mode.Merge)]
13+
public CreateDBAssignedCommandValidator()
14+
{
15+
ConfigureValidationRules();
16+
}
17+
18+
private void ConfigureValidationRules()
19+
{
20+
RuleFor(v => v.Name)
21+
.NotNull();
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)