generator-codedesignplus 0.1.0-beta.2 → 0.1.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/generators/microservice/core/appsettings.mjs +14 -3
  2. package/generators/microservice/core/utils.mjs +7 -7
  3. package/generators/microservice/templates/microservice/LICENSE.md +21 -0
  4. package/generators/microservice/templates/microservice/README.md +175 -0
  5. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/CodeDesignPlus.Net.Microservice.Application.csproj +4 -4
  6. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/AddProductToOrder/AddProductToOrderCommandHandler.cs +3 -4
  7. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/CancelOrder/CancelOrderCommandHandler.cs +5 -4
  8. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/CompleteOrder/CompleteOrderCommandHandler.cs +2 -2
  9. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/CreateOrder/CreateOrderCommandHandler.cs +4 -5
  10. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/RemoveProduct/RemoveProductCommandHandler.cs +2 -2
  11. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Commands/UpdateQuantityProduct/UpdateQuantityProductCommandHandler.cs +3 -4
  12. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/DataTransferObjects/OrderDto.cs +4 -4
  13. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Queries/FindOrderById/FindOrderByIdQueryHandler.cs +3 -6
  14. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Order/Queries/GetAllOrders/GetAllOrdersQueryHandler.cs +3 -6
  15. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Usings.cs +1 -0
  16. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/CodeDesignPlus.Net.Microservice.Domain.csproj +2 -2
  17. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/AddProductToOrderParams.cs +1 -2
  18. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/CancelOrderParams.cs +2 -2
  19. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/CompleteOrderParams.cs +2 -2
  20. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/RemoveProductFromOrderParams.cs +1 -1
  21. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DataTransferObjects/UpdateQuantityProductParams.cs +1 -2
  22. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/OrderCancelledDomainEvent.cs +4 -4
  23. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/OrderCompletedDomainEvent.cs +4 -4
  24. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/OrderCreatedDomainEvent.cs +4 -4
  25. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/ProductAddedToOrderDomainEvent.cs +1 -1
  26. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/ProductQuantityUpdatedDomainEvent.cs +1 -1
  27. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/DomainEvents/ProductRemovedFromOrderDomainEvent.cs +1 -1
  28. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/OrderAggregate.cs +13 -15
  29. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/Repositories/IOrderRepository.cs +5 -9
  30. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/Usings.cs +1 -0
  31. package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Infrastructure/Repositories/OrderRepository.cs +29 -39
  32. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/CodeDesignPlus.Net.Microservice.AsyncWorker.csproj +8 -8
  33. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Dockerfile +36 -0
  34. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Program.cs +1 -1
  35. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Properties/launchSettings.json +5 -5
  36. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.Docker.json +25 -0
  37. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.json +9 -45
  38. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesignPlus.Net.Microservice.Rest.csproj +9 -8
  39. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Dockerfile +7 -8
  40. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Program.cs +6 -1
  41. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Properties/launchSettings.json +3 -5
  42. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.Docker.json +25 -0
  43. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.json +12 -4
  44. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj +12 -10
  45. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Core/Mapster/MapsterConfig.cs +10 -2
  46. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Dockerfile +36 -0
  47. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Program.cs +1 -3
  48. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Properties/launchSettings.json +2 -11
  49. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Protos/orders.proto +7 -7
  50. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Services/OrderService.cs +1 -2
  51. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.Docker.json +25 -0
  52. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.json +7 -5
  53. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/CodeDesignPlus.Net.Microservice.AsyncWorker.Test.csproj +5 -5
  54. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/CodeDesignPlus.Net.Microservice.Rest.Test.csproj +6 -6
  55. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/Controllers/OrderControllerTest.cs +28 -28
  56. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/Usings.cs +1 -0
  57. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/CodeDesignPlus.Net.Microservice.gRpc.Test.csproj +11 -9
  58. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/Protos/orders.proto +8 -7
  59. package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/Services/{OrdersServiceTest.cs → OrderServiceTest.cs} +13 -6
  60. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/CodeDesignPlus.Net.Microservice.Application.Test.csproj +4 -4
  61. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/AddProductToOrder/AddProductToOrderCommandHandlerTest.cs +6 -6
  62. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/CancelOrder/CancelOrderCommandHandlerTest.cs +6 -7
  63. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/CompleteOrder/CompleteOrderCommandHandlerTest.cs +6 -6
  64. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/CreateOrder/CreateOrderCommandHandlerTest.cs +11 -11
  65. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/RemoveProduct/RemoveProductCommandHandlerTest.cs +7 -5
  66. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Commands/UpdateQuantityProduct/UpdateQuantityProductCommandHandlerTest.cs +6 -6
  67. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Queries/FindOrderById/FindOrderByIdQueryHandlerTest.cs +18 -6
  68. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Order/Queries/GetAllOrders/GetAllOrdersQueryHandlerTest.cs +11 -7
  69. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Application.Test/Usings.cs +1 -0
  70. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/CodeDesignPlus.Net.Microservice.AsyncWorker.Test.csproj +5 -5
  71. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/Usings.cs +0 -1
  72. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Default.Test/CodeDesignPlus.Net.Microservice.Default.Test.csproj +6 -6
  73. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/CodeDesignPlus.Net.Microservice.Domain.Test.csproj +4 -4
  74. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/DomainEvents/OrderCancelledDomainEventTest.cs +3 -3
  75. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/OrderAggregateTest.cs +2 -2
  76. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Domain.Test/Usings.cs +2 -0
  77. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Infrastructure.Test/CodeDesignPlus.Net.Microservice.Infrastructure.Test.csproj +4 -4
  78. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Infrastructure.Test/Repositories/OrderRepositoryTest.cs +20 -91
  79. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Infrastructure.Test/Usings.cs +1 -0
  80. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Rest.Test/CodeDesignPlus.Net.Microservice.Rest.Test.csproj +5 -5
  81. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.gRpc.Test/CodeDesignPlus.Net.Microservice.gRpc.Test.csproj +5 -5
  82. package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.gRpc.Test/Services/OrderServiceTest.cs +2 -2
  83. package/generators/microservice/templates/microservice/tools/vault/config-vault.ps1 +2 -2
  84. package/generators/microservice/templates/microservice/tools/vault/config-vault.sh +1 -2
  85. package/package.json +1 -1
  86. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.Development.json +0 -2
  87. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesignPlus.Net.Microservice.Rest.csproj.user +0 -11
  88. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.Development.json +0 -3
  89. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj.user +0 -9
  90. package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.Development.json +0 -3
@@ -3,16 +3,17 @@
3
3
  <TargetFramework>net9.0</TargetFramework>
4
4
  <Nullable>enable</Nullable>
5
5
  <ImplicitUsings>enable</ImplicitUsings>
6
+ <Protobuf_UseNodaTime>true</Protobuf_UseNodaTime>
6
7
  </PropertyGroup>
7
8
  <ItemGroup Label="Protos">
8
9
  <Protobuf Include="Protos\orders.proto" GrpcServices="Server" />
9
10
  </ItemGroup>
10
11
  <ItemGroup>
11
- <PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.5.0-beta.60" />
12
- <PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.5.0-beta.60" />
12
+ <PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.5.0-beta.81" />
13
+ <PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.5.0-beta.81" />
13
14
  <PackageReference Include="Grpc.AspNetCore" Version="2.67.0" />
14
15
  <PackageReference Include="Grpc.AspNetCore.Server.Reflection" Version="2.67.0" />
15
- <PackageReference Include="Grpc.Tools" Version="2.68.1">
16
+ <PackageReference Include="Grpc.Tools" Version="2.69.0">
16
17
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17
18
  <PrivateAssets>all</PrivateAssets>
18
19
  </PackageReference>
@@ -24,12 +25,13 @@
24
25
  </ItemGroup>
25
26
  <ItemGroup>
26
27
  <ProjectReference Include="..\..\domain\CodeDesignPlus.Net.Microservice.Infrastructure\CodeDesignPlus.Net.Microservice.Infrastructure.csproj" />
27
- <PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.5.0-beta.60" />
28
- <PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.5.0-beta.60" />
29
- <PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.5.0-beta.60" />
30
- <PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.5.0-beta.60" />
31
- <PackageReference Include="CodeDesignPlus.Net.Security" Version="0.5.0-beta.60" />
32
- <PackageReference Include="CodeDesignPlus.Net.Exceptions" Version="0.5.0-beta.60" />
33
- <PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.5.0-beta.60" />
28
+ <PackageReference Include="NodaTime.Serialization.Protobuf" Version="2.0.2" />
29
+ <PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.5.0-beta.81" />
30
+ <PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.5.0-beta.81" />
31
+ <PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.5.0-beta.81" />
32
+ <PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.5.0-beta.81" />
33
+ <PackageReference Include="CodeDesignPlus.Net.Security" Version="0.5.0-beta.81" />
34
+ <PackageReference Include="CodeDesignPlus.Net.Exceptions" Version="0.5.0-beta.81" />
35
+ <PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.5.0-beta.81" />
34
36
  </ItemGroup>
35
37
  </Project>
@@ -1,11 +1,19 @@
1
- namespace CodeDesignPlus.Net.Microservice.gRpc.Core.Mapster;
1
+ using NodaTime;
2
+ using NodaTime.Serialization.Protobuf;
3
+
4
+ namespace CodeDesignPlus.Net.Microservice.gRpc.Core.Mapster;
2
5
 
3
6
  public static class MapsterConfig
4
7
  {
5
8
  public static void Configure()
6
9
  {
7
10
  TypeAdapterConfig<Net.Core.Abstractions.Models.Criteria.Criteria, Net.Core.Abstractions.Models.Criteria.Criteria>.NewConfig().TwoWays();
8
- TypeAdapterConfig<OrderDto, Order>.NewConfig().TwoWays();
11
+ TypeAdapterConfig<OrderDto, Order>
12
+ .NewConfig()
13
+ .Map(dest => dest.CreatedAt, src => src.CreatedAt.ToTimestamp())
14
+ .Map(dest => dest.UpdatedAt, src => (src.UpdatedAt ?? Instant.MinValue).ToTimestamp())
15
+ .Map(dest => dest.CompletedAt, src => (src.CompletedAt ?? Instant.MinValue).ToTimestamp())
16
+ .Map(dest => dest.CancelledAt, src => (src.CancelledAt ?? Instant.MinValue).ToTimestamp());
9
17
 
10
18
  TypeAdapterConfig<ClientDto, Client>.NewConfig().TwoWays();
11
19
  TypeAdapterConfig<ProductDto, Product>.NewConfig().TwoWays();
@@ -0,0 +1,36 @@
1
+ #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2
+
3
+ FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
4
+ USER app
5
+ WORKDIR /app
6
+ EXPOSE 8080
7
+
8
+ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
9
+ # Install clang/zlib1g-dev dependencies for publishing to native
10
+ RUN apt-get update \
11
+ && apt-get install -y --no-install-recommends \
12
+ clang zlib1g-dev \
13
+ && apt-get clean
14
+
15
+ ARG BUILD_CONFIGURATION=Release
16
+ WORKDIR /src
17
+ COPY ["src/domain/", "domain/"]
18
+ COPY ["src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/", "entrypoints/CodeDesignPlus.Net.Microservice.gRpc/"]
19
+ RUN dotnet restore "./entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj"
20
+
21
+ WORKDIR "/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc"
22
+ RUN dotnet build "./CodeDesignPlus.Net.Microservice.gRpc.csproj" -c "$BUILD_CONFIGURATION" -o /app/build
23
+
24
+ FROM build AS publish
25
+ WORKDIR /src
26
+ ARG BUILD_CONFIGURATION=Release
27
+ RUN dotnet publish "./entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj" \
28
+ -c "$BUILD_CONFIGURATION" \
29
+ -o /app/publish /p:UseAppHost=true
30
+
31
+ FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
32
+ USER app
33
+ WORKDIR /app
34
+ EXPOSE 8080
35
+ COPY --from=publish /app/publish .
36
+ ENTRYPOINT ["dotnet", "CodeDesignPlus.Net.Microservice.gRpc.dll"]
@@ -19,7 +19,6 @@ builder.Host.UseSerilog();
19
19
 
20
20
  builder.Configuration.AddVault();
21
21
 
22
- // Add services to the container.
23
22
  builder.Services.AddGrpc(options =>
24
23
  {
25
24
  options.Interceptors.Add<ErrorInterceptor>();
@@ -43,8 +42,7 @@ var app = builder.Build();
43
42
 
44
43
  app.UseAuth();
45
44
 
46
- // Configure the HTTP request pipeline.
47
- app.MapGrpcService<OrdersService>().RequireAuthorization();
45
+ app.MapGrpcService<OrderService>().RequireAuthorization();
48
46
 
49
47
  if (app.Environment.IsDevelopment())
50
48
  {
@@ -4,17 +4,8 @@
4
4
  "http": {
5
5
  "commandName": "Project",
6
6
  "dotnetRunMessages": true,
7
- "launchBrowser": false,
8
- "applicationUrl": "http://localhost:5103",
9
- "environmentVariables": {
10
- "ASPNETCORE_ENVIRONMENT": "Development"
11
- }
12
- },
13
- "https": {
14
- "commandName": "Project",
15
- "dotnetRunMessages": true,
16
- "launchBrowser": false,
17
- "applicationUrl": "https://localhost:7263;http://localhost:5103",
7
+ "launchBrowser": true,
8
+ "applicationUrl": "http://localhost:5001",
18
9
  "environmentVariables": {
19
10
  "ASPNETCORE_ENVIRONMENT": "Development"
20
11
  }
@@ -2,7 +2,7 @@ syntax = "proto3";
2
2
 
3
3
 
4
4
  import "google/protobuf/wrappers.proto";
5
- import "google/protobuf/empty.proto";
5
+ import "google/protobuf/timestamp.proto";
6
6
 
7
7
  option csharp_namespace = "CodeDesignPlus.Net.Microservice.gRpc";
8
8
 
@@ -20,7 +20,7 @@ enum OrderStatus
20
20
  Created = 1;
21
21
  Pending = 2;
22
22
  Completed = 3;
23
- Cancelled= 4;
23
+ Cancelled = 4;
24
24
  }
25
25
 
26
26
  // The orders service definition.
@@ -39,16 +39,16 @@ message GetOrderResponse {
39
39
 
40
40
  message Order {
41
41
  string id = 1;
42
- google.protobuf.Int64Value completed_at = 2;
43
- google.protobuf.Int64Value cancelled_at = 3;
42
+ google.protobuf.Timestamp completed_at = 2;
43
+ google.protobuf.Timestamp cancelled_at = 3;
44
44
  Client client = 4;
45
45
  repeated Product products = 5;
46
46
  OrderStatus status = 6;
47
47
  google.protobuf.StringValue reason_for_cancellation = 7;
48
- int64 created_at = 8;
48
+ google.protobuf.Timestamp created_at = 8;
49
49
  string created_by = 9;
50
- int64 updated_at = 10;
51
- string updated_by = 11;
50
+ optional google.protobuf.Timestamp updated_at = 10;
51
+ optional string updated_by = 11;
52
52
  bool is_active = 12;
53
53
  }
54
54
 
@@ -1,7 +1,6 @@
1
-
2
1
  namespace CodeDesignPlus.Net.Microservice.gRpc.Services;
3
2
 
4
- public class OrdersService(IMediator mediator, IMapper mapper) : Orders.OrdersBase
3
+ public class OrderService(IMediator mediator, IMapper mapper) : Orders.OrdersBase
5
4
  {
6
5
  public override async Task GetOrder(IAsyncStreamReader<GetOrderRequest> requestStream, IServerStreamWriter<GetOrderResponse> responseStream, ServerCallContext context)
7
6
  {
@@ -0,0 +1,25 @@
1
+ {
2
+ "Redis": {
3
+ "Instances": {
4
+ "Core": {
5
+ "ConnectionString": "host.docker.internal:6379"
6
+ }
7
+ }
8
+ },
9
+ "RabbitMQ": {
10
+ "Host": "host.docker.internal"
11
+ },
12
+ "Logger": {
13
+ "OTelEndpoint": "http://host.docker.internal:4317"
14
+ },
15
+ "Observability": {
16
+ "ServerOtel": "http://host.docker.internal:4317"
17
+ },
18
+ "Vault": {
19
+ "Address": "http://host.docker.internal:8200",
20
+ "Mongo": {
21
+ "TemplateConnectionString": "mongodb://{0}:{1}@host.docker.internal:27017"
22
+ }
23
+ }
24
+ }
25
+
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "Kestrel": {
3
3
  "Endpoints": {
4
- "Http": {
5
- "Url": "http://*:5000"
6
- },
7
4
  "Http2": {
8
5
  "Url": "http://*:5001",
9
6
  "Protocols": "Http2"
@@ -81,12 +78,17 @@
81
78
  }
82
79
  },
83
80
  "Vault": {
81
+ "Enable": true,
84
82
  "Address": "http://127.0.0.1:8200",
85
83
  "AppName": "ms-archetype",
86
- "Solution": "archetype",
84
+ "Solution": "vault",
87
85
  "Token": "root",
88
86
  "Mongo": {
87
+ "Enable": true,
89
88
  "TemplateConnectionString": "mongodb://{0}:{1}@localhost:27017"
89
+ },
90
+ "RabbitMQ": {
91
+ "Enable": true
90
92
  }
91
93
  }
92
- }
94
+ }
@@ -7,16 +7,16 @@
7
7
  <IsTestProject>true</IsTestProject>
8
8
  </PropertyGroup>
9
9
  <ItemGroup>
10
- <PackageReference Include="coverlet.collector" Version="6.0.3">
10
+ <PackageReference Include="coverlet.collector" Version="6.0.4">
11
11
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12
12
  <PrivateAssets>all</PrivateAssets>
13
13
  </PackageReference>
14
- <PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.5.0-beta.60" />
14
+ <PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.5.0-beta.81" />
15
15
  <PackageReference Include="Ductus.FluentDocker.XUnit" Version="2.10.59" />
16
- <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
16
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.1" />
17
17
  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
18
- <PackageReference Include="xunit" Version="2.9.2" />
19
- <PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
18
+ <PackageReference Include="xunit" Version="2.9.3" />
19
+ <PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
20
20
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21
21
  <PrivateAssets>all</PrivateAssets>
22
22
  </PackageReference>
@@ -7,17 +7,17 @@
7
7
  <IsTestProject>true</IsTestProject>
8
8
  </PropertyGroup>
9
9
  <ItemGroup>
10
- <PackageReference Include="coverlet.collector" Version="6.0.3">
10
+ <PackageReference Include="coverlet.collector" Version="6.0.4">
11
11
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12
12
  <PrivateAssets>all</PrivateAssets>
13
13
  </PackageReference>
14
- <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
15
- <PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.5.0-beta.60" />
16
- <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
14
+ <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
15
+ <PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.5.0-beta.81" />
16
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.1" />
17
17
  <PackageReference Include="Ductus.FluentDocker.XUnit" Version="2.10.59" />
18
18
  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
19
- <PackageReference Include="xunit" Version="2.9.2" />
20
- <PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
19
+ <PackageReference Include="xunit" Version="2.9.3" />
20
+ <PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
21
21
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22
22
  <PrivateAssets>all</PrivateAssets>
23
23
  </PackageReference>
@@ -3,10 +3,10 @@
3
3
  public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Program>>
4
4
  {
5
5
  public OrderControllerTest(Server<Program> server) : base(server)
6
- {
6
+ {
7
7
  server.InMemoryCollection = (x) =>
8
8
  {
9
- x.Add("Vault:Enabled", "false");
9
+ x.Add("Vault:Enable", "false");
10
10
  x.Add("Vault:Address", "http://localhost:8200");
11
11
  x.Add("Vault:Token", "root");
12
12
  x.Add("Solution", "CodeDesignPlus");
@@ -30,7 +30,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
30
30
 
31
31
  var json = await response.Content.ReadAsStringAsync();
32
32
 
33
- var orders = Newtonsoft.Json.JsonConvert.DeserializeObject<IEnumerable<OrderDto>>(json);
33
+ var orders = JsonSerializer.Deserialize<IEnumerable<OrderDto>>(json);
34
34
 
35
35
  Assert.NotNull(orders);
36
36
  Assert.NotEmpty(orders);
@@ -50,7 +50,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
50
50
 
51
51
  var json = await response.Content.ReadAsStringAsync();
52
52
 
53
- var order = Newtonsoft.Json.JsonConvert.DeserializeObject<OrderDto>(json);
53
+ var order = JsonSerializer.Deserialize<OrderDto>(json);
54
54
 
55
55
  Assert.NotNull(order);
56
56
  Assert.Equal(orderCreated.Id, order.Id);
@@ -82,13 +82,13 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
82
82
  }
83
83
  };
84
84
 
85
- var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
85
+ var json = JsonSerializer.Serialize(data);
86
86
 
87
87
  var content = new StringContent(json, Encoding.UTF8, "application/json");
88
88
 
89
89
  var response = await this.RequestAsync("http://localhost/api/Orders", tenant, content, HttpMethod.Post);
90
90
 
91
- var order = await this.GetRecordAsync(data.Id);
91
+ var order = await this.GetRecordAsync(data.Id, tenant);
92
92
 
93
93
  Assert.NotNull(response);
94
94
  Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
@@ -98,8 +98,8 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
98
98
  Assert.Equal(data.Client.Id, order.Client.Id);
99
99
  Assert.NotEqual(Guid.Empty, order.CreatedBy);
100
100
  Assert.Equal(Guid.Empty, order.UpdatedBy);
101
- Assert.NotEqual(0, order.CreatedAt);
102
- Assert.Equal(0, order.UpdatedAt);
101
+ Assert.True(order.CreatedAt > Instant.MinValue);
102
+ Assert.Null(order.UpdatedAt);
103
103
  }
104
104
 
105
105
  [Fact]
@@ -116,7 +116,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
116
116
  // Act
117
117
  var response = await this.RequestAsync($"http://localhost/api/Orders/{orderCreated.Id}/cancel", tenant, content, HttpMethod.Delete);
118
118
 
119
- var order = await this.GetRecordAsync(orderCreated.Id);
119
+ var order = await this.GetRecordAsync(orderCreated.Id, tenant);
120
120
 
121
121
  Assert.NotNull(response);
122
122
  Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
@@ -125,8 +125,8 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
125
125
  Assert.NotNull(order.CancelledAt);
126
126
  Assert.NotEqual(Guid.Empty, order.CreatedBy);
127
127
  Assert.NotEqual(Guid.Empty, order.UpdatedBy);
128
- Assert.NotEqual(0, order.CreatedAt);
129
- Assert.NotEqual(0, order.UpdatedAt);
128
+ Assert.True(order.CreatedAt > Instant.MinValue);
129
+ Assert.True(order.UpdatedAt > Instant.MinValue);
130
130
  }
131
131
 
132
132
  [Fact]
@@ -139,7 +139,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
139
139
  // Act
140
140
  var response = await this.RequestAsync($"http://localhost/api/Orders/{orderCreated.Id}/complete", tenant, null, HttpMethod.Patch);
141
141
 
142
- var order = await this.GetRecordAsync(orderCreated.Id);
142
+ var order = await this.GetRecordAsync(orderCreated.Id, tenant);
143
143
 
144
144
  Assert.NotNull(response);
145
145
  Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
@@ -147,8 +147,8 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
147
147
  Assert.NotNull(order.CompletedAt);
148
148
  Assert.NotEqual(Guid.Empty, order.CreatedBy);
149
149
  Assert.NotEqual(Guid.Empty, order.UpdatedBy);
150
- Assert.NotEqual(0, order.CreatedAt);
151
- Assert.NotEqual(0, order.UpdatedAt);
150
+ Assert.True(order.CreatedAt > Instant.MinValue);
151
+ Assert.True(order.UpdatedAt > Instant.MinValue);
152
152
  }
153
153
 
154
154
  [Fact]
@@ -173,7 +173,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
173
173
  // Act
174
174
  var response = await this.RequestAsync($"http://localhost/api/Orders/{orderCreated.Id}/products", tenant, content, HttpMethod.Post);
175
175
 
176
- var order = await this.GetRecordAsync(orderCreated.Id);
176
+ var order = await this.GetRecordAsync(orderCreated.Id, tenant);
177
177
 
178
178
  Assert.NotNull(response);
179
179
  Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
@@ -185,8 +185,8 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
185
185
  Assert.Equal(addProduct.Quantity, order.Products.First().Quantity);
186
186
  Assert.NotEqual(Guid.Empty, order.CreatedBy);
187
187
  Assert.NotEqual(Guid.Empty, order.UpdatedBy);
188
- Assert.NotEqual(0, order.CreatedAt);
189
- Assert.NotEqual(0, order.UpdatedAt);
188
+ Assert.True(order.CreatedAt > Instant.MinValue);
189
+ Assert.True(order.UpdatedAt > Instant.MinValue);
190
190
  }
191
191
 
192
192
  [Fact]
@@ -222,7 +222,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
222
222
  // Act
223
223
  var response = await this.RequestAsync($"http://localhost/api/Orders/{orderCreated.Id}/products/{addProduct.IdProduct}", tenant, content, HttpMethod.Put);
224
224
 
225
- var order = await this.GetRecordAsync(orderCreated.Id);
225
+ var order = await this.GetRecordAsync(orderCreated.Id, tenant);
226
226
 
227
227
  Assert.NotNull(response);
228
228
  Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
@@ -230,8 +230,8 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
230
230
  Assert.Equal(updateQuantity.Quantity, order.Products.First().Quantity);
231
231
  Assert.NotEqual(Guid.Empty, order.CreatedBy);
232
232
  Assert.NotEqual(Guid.Empty, order.UpdatedBy);
233
- Assert.NotEqual(0, order.CreatedAt);
234
- Assert.NotEqual(0, order.UpdatedAt);
233
+ Assert.True(order.CreatedAt > Instant.MinValue);
234
+ Assert.True(order.UpdatedAt > Instant.MinValue);
235
235
  }
236
236
 
237
237
  [Fact]
@@ -258,20 +258,20 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
258
258
  // Act
259
259
  var response = await this.RequestAsync($"http://localhost/api/Orders/{orderCreated.Id}/products/{addProduct.IdProduct}", tenant, null, HttpMethod.Delete);
260
260
 
261
- var order = await this.GetRecordAsync(orderCreated.Id);
261
+ var order = await this.GetRecordAsync(orderCreated.Id, tenant);
262
262
 
263
263
  Assert.NotNull(response);
264
264
  Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
265
265
  Assert.Empty(order.Products);
266
266
  Assert.NotEqual(Guid.Empty, order.CreatedBy);
267
267
  Assert.NotEqual(Guid.Empty, order.UpdatedBy);
268
- Assert.NotEqual(0, order.CreatedAt);
269
- Assert.NotEqual(0, order.UpdatedAt);
268
+ Assert.True(order.CreatedAt > Instant.MinValue);
269
+ Assert.True(order.UpdatedAt > Instant.MinValue);
270
270
  }
271
271
 
272
272
  private static StringContent BuildBody(object data)
273
273
  {
274
- var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
274
+ var json = JsonSerializer.Serialize(data);
275
275
 
276
276
  var content = new StringContent(json, Encoding.UTF8, "application/json");
277
277
 
@@ -300,7 +300,7 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
300
300
  }
301
301
  };
302
302
 
303
- var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
303
+ var json = JsonSerializer.Serialize(data);
304
304
 
305
305
  var content = new StringContent(json, Encoding.UTF8, "application/json");
306
306
 
@@ -309,13 +309,13 @@ public class OrderControllerTest : ServerBase<Program>, IClassFixture<Server<Pro
309
309
  return data;
310
310
  }
311
311
 
312
- private async Task<OrderDto> GetRecordAsync(Guid id)
312
+ private async Task<OrderDto> GetRecordAsync(Guid id, Guid tenant)
313
313
  {
314
- var response = await this.RequestAsync($"http://localhost/api/Orders/{id}", Guid.NewGuid(), null, HttpMethod.Get);
314
+ var response = await this.RequestAsync($"http://localhost/api/Orders/{id}", tenant, null, HttpMethod.Get);
315
315
 
316
316
  var json = await response.Content.ReadAsStringAsync();
317
317
 
318
- return Newtonsoft.Json.JsonConvert.DeserializeObject<OrderDto>(json)!;
318
+ return JsonSerializer.Deserialize<OrderDto>(json)!;
319
319
  }
320
320
 
321
321
  private async Task<HttpResponseMessage> RequestAsync(string uri, Guid tenant, HttpContent? content, HttpMethod method)
@@ -4,5 +4,6 @@ global using System.Net;
4
4
  global using System.Net.Http.Headers;
5
5
  global using System.Text;
6
6
  global using CodeDesignPlus.Net.Serializers;
7
+ global using NodaTime;
7
8
 
8
9
  global using CodeDesignPlus.Net.Microservice.Application.Order.DataTransferObjects;
@@ -5,25 +5,27 @@
5
5
  <Nullable>enable</Nullable>
6
6
  <IsPackable>false</IsPackable>
7
7
  <IsTestProject>true</IsTestProject>
8
+ <Protobuf_UseNodaTime>true</Protobuf_UseNodaTime>
8
9
  </PropertyGroup>
9
10
  <ItemGroup>
10
- <PackageReference Include="coverlet.collector" Version="6.0.3">
11
+ <PackageReference Include="coverlet.collector" Version="6.0.4">
11
12
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12
13
  <PrivateAssets>all</PrivateAssets>
13
14
  </PackageReference>
14
- <PackageReference Include="Google.Protobuf" Version="3.29.2" />
15
+ <PackageReference Include="Google.Protobuf" Version="3.29.3" />
15
16
  <PackageReference Include="Grpc.Net.Client" Version="2.67.0" />
16
- <PackageReference Include="Grpc.Tools" Version="2.68.1">
17
+ <PackageReference Include="Grpc.Tools" Version="2.69.0">
17
18
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18
19
  <PrivateAssets>all</PrivateAssets>
19
20
  </PackageReference>
20
- <PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.5.0-beta.60" />
21
- <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
22
- <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
23
- <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.0.0" />
21
+ <PackageReference Include="NodaTime.Serialization.Protobuf" Version="2.0.2" />
22
+ <PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.5.0-beta.81" />
23
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.1" />
24
+ <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
25
+ <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.0.1" />
24
26
  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
25
- <PackageReference Include="xunit" Version="2.9.2" />
26
- <PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
27
+ <PackageReference Include="xunit" Version="2.9.3" />
28
+ <PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
27
29
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28
30
  <PrivateAssets>all</PrivateAssets>
29
31
  </PackageReference>
@@ -1,7 +1,8 @@
1
1
  syntax = "proto3";
2
2
 
3
-
4
3
  import "google/protobuf/wrappers.proto";
4
+ import "google/protobuf/empty.proto";
5
+ import "google/protobuf/timestamp.proto";
5
6
 
6
7
  option csharp_namespace = "CodeDesignPlus.Net.Microservice.gRpc.Test";
7
8
 
@@ -19,7 +20,7 @@ enum OrderStatus
19
20
  Created = 1;
20
21
  Pending = 2;
21
22
  Completed = 3;
22
- Cancelled= 4;
23
+ Cancelled = 4;
23
24
  }
24
25
 
25
26
  // The orders service definition.
@@ -38,16 +39,16 @@ message GetOrderResponse {
38
39
 
39
40
  message Order {
40
41
  string id = 1;
41
- google.protobuf.Int64Value completed_at = 2;
42
- google.protobuf.Int64Value cancelled_at = 3;
42
+ google.protobuf.Timestamp completed_at = 2;
43
+ google.protobuf.Timestamp cancelled_at = 3;
43
44
  Client client = 4;
44
45
  repeated Product products = 5;
45
46
  OrderStatus status = 6;
46
47
  google.protobuf.StringValue reason_for_cancellation = 7;
47
- int64 created_at = 8;
48
+ google.protobuf.Timestamp created_at = 8;
48
49
  string created_by = 9;
49
- int64 updated_at = 10;
50
- string updated_by = 11;
50
+ optional google.protobuf.Timestamp updated_at = 10;
51
+ optional string updated_by = 11;
51
52
  bool is_active = 12;
52
53
  }
53
54
 
@@ -1,14 +1,16 @@
1
1
  using CodeDesignPlus.Net.Microservice.Domain.ValueObjects;
2
+ using NodaTime;
3
+ using NodaTime.Serialization.Protobuf;
2
4
 
3
5
  namespace CodeDesignPlus.Net.Microservice.gRpc.Test.Services;
4
6
 
5
- public class OrdersServiceTest : ServerBase<Program>, IClassFixture<Server<Program>>
7
+ public class OrderServiceTest : ServerBase<Program>, IClassFixture<Server<Program>>
6
8
  {
7
- public OrdersServiceTest(Server<Program> server) : base(server)
9
+ public OrderServiceTest(Server<Program> server) : base(server)
8
10
  {
9
11
  server.InMemoryCollection = (x) =>
10
12
  {
11
- x.Add("Vault:Enabled", "false");
13
+ x.Add("Vault:Enable", "false");
12
14
  x.Add("Vault:Address", "http://localhost:8200");
13
15
  x.Add("Vault:Token", "root");
14
16
  x.Add("Solution", "CodeDesignPlus");
@@ -32,7 +34,12 @@ public class OrdersServiceTest : ServerBase<Program>, IClassFixture<Server<Progr
32
34
 
33
35
  await repository.CreateAsync(orderExpected, CancellationToken.None);
34
36
 
35
- using var streamingCall = orderClient.GetOrder();
37
+ var metadata = new Metadata
38
+ {
39
+ new("X-Tenant", orderExpected.Tenant.ToString())
40
+ };
41
+
42
+ using var streamingCall = orderClient.GetOrder(metadata);
36
43
 
37
44
  _ = Task.Run(async () =>
38
45
  {
@@ -43,7 +50,7 @@ public class OrdersServiceTest : ServerBase<Program>, IClassFixture<Server<Progr
43
50
  Assert.Equal(orderExpected.Client.Id.ToString(), response.Order.Client.Id);
44
51
  Assert.Equal(orderExpected.Client.Name, response.Order.Client.Name);
45
52
  Assert.Equal(orderExpected.CreatedBy.ToString(), response.Order.CreatedBy);
46
- Assert.True(response.Order.CreatedAt > 0);
53
+ Assert.True(response.Order.CreatedAt.ToInstant() > Instant.MinValue);
47
54
 
48
55
  isInvoked = true;
49
56
  }
@@ -54,7 +61,7 @@ public class OrdersServiceTest : ServerBase<Program>, IClassFixture<Server<Progr
54
61
  Id = orderExpected.Id.ToString()
55
62
  });
56
63
 
57
- await Task.Delay(1000);
64
+ await Task.Delay(2000);
58
65
 
59
66
  await streamingCall.RequestStream.CompleteAsync();
60
67