Browse Source

Newtonsoft.Json and MediatR with fixes of all based on MediatR classes

also from csproj files excluded direct specification of runtime to make compile happy if on a system we have higher version.
pull/223/head
igorsych 7 years ago
parent
commit
ec07a68751
28 changed files with 40 additions and 84 deletions
  1. +1
    -2
      src/BuildingBlocks/EventBus/EventBus/EventBus.csproj
  2. +2
    -3
      src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj
  3. +1
    -2
      src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj
  4. +1
    -1
      src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj
  5. +2
    -2
      src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj
  6. +1
    -6
      src/Services/Basket/Basket.API/Basket.API.csproj
  7. +1
    -6
      src/Services/Catalog/Catalog.API/Catalog.API.csproj
  8. +0
    -5
      src/Services/Identity/Identity.API/Identity.API.csproj
  9. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs
  10. +2
    -5
      src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommand.cs
  11. +2
    -2
      src/Services/Ordering/Ordering.API/Application/Commands/IdentifierCommandHandler.cs
  12. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Decorators/LogDecorator.cs
  13. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Decorators/ValidatorDecorator.cs
  14. +2
    -2
      src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs
  15. +2
    -7
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  16. +1
    -4
      src/Services/Ordering/Ordering.Domain/Events/BuyerPaymentMethodVerifiedDomainEvent.cs
  17. +1
    -1
      src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs
  18. +2
    -2
      src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj
  19. +6
    -6
      src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs
  20. +1
    -1
      src/Services/Ordering/Ordering.Infrastructure/MediatorExtension.cs
  21. +1
    -6
      src/Web/WebMVC/WebMVC.csproj
  22. +1
    -5
      src/Web/WebSPA/WebSPA.csproj
  23. +0
    -1
      src/Web/WebStatus/WebStatus.csproj
  24. +0
    -1
      test/Services/FunctionalTests/FunctionalTests.csproj
  25. +0
    -1
      test/Services/IntegrationTests/IntegrationTests.csproj
  26. +4
    -4
      test/Services/UnitTest/Ordering/Application/IdentifierCommandHandlerTest.cs
  27. +2
    -2
      test/Services/UnitTest/Ordering/Application/OrdersWebApiTest.cs
  28. +1
    -4
      test/Services/UnitTest/UnitTest.csproj

+ 1
- 2
src/BuildingBlocks/EventBus/EventBus/EventBus.csproj View File

@ -2,7 +2,6 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace>
</PropertyGroup>
@ -11,7 +10,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
</ItemGroup>
</Project>

+ 2
- 3
src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj View File

@ -2,14 +2,13 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Polly" Version="5.0.6" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Polly" Version="5.1.0" />
<PackageReference Include="RabbitMQ.Client" Version="4.1.3" />
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
</ItemGroup>


+ 1
- 2
src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj View File

@ -2,7 +2,6 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF</RootNamespace>
</PropertyGroup>
@ -13,7 +12,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
</ItemGroup>
<ItemGroup>


+ 1
- 1
src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj View File

@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />


+ 2
- 2
src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj View File

@ -7,8 +7,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Polly" Version="5.0.6" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Polly" Version="5.1.0" />
</ItemGroup>
</Project>

+ 1
- 6
src/Services/Basket/Basket.API/Basket.API.csproj View File

@ -2,12 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Basket.API</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Basket.API</PackageId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
@ -35,7 +30,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
<PackageReference Include="StackExchange.Redis" Version="1.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="1.2.0" />
</ItemGroup>


+ 1
- 6
src/Services/Catalog/Catalog.API/Catalog.API.csproj View File

@ -2,13 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Catalog.API</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Catalog.API</PackageId>
<UserSecretsId>aspnet-Catalog.API-20161122013618</UserSecretsId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
@ -47,7 +42,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
</ItemGroup>


+ 0
- 5
src/Services/Identity/Identity.API/Identity.API.csproj View File

@ -2,13 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Identity.API</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Identity.API</PackageId>
<UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs View File

@ -17,7 +17,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
[DataContract]
public class CreateOrderCommand
:IAsyncRequest<bool>
: IRequest<bool>
{
[DataMember]
private readonly List<OrderItemDTO> _orderItems;


+ 2
- 5
src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommand.cs View File

@ -1,13 +1,10 @@
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
{
public class IdentifiedCommand<T, R> : IAsyncRequest<R>
where T : IAsyncRequest<R>
public class IdentifiedCommand<T, R> : IRequest<R>
where T : IRequest<R>
{
public T Command { get; }
public Guid Id { get; }


+ 2
- 2
src/Services/Ordering/Ordering.API/Application/Commands/IdentifierCommandHandler.cs View File

@ -11,7 +11,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
/// <typeparam name="T">Type of the command handler that performs the operation if request is not duplicated</typeparam>
/// <typeparam name="R">Return value of the inner command handler</typeparam>
public class IdentifierCommandHandler<T, R> : IAsyncRequestHandler<IdentifiedCommand<T, R>, R>
where T : IAsyncRequest<R>
where T : IRequest<R>
{
private readonly IMediator _mediator;
private readonly IRequestManager _requestManager;
@ -48,7 +48,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
{
await _requestManager.CreateRequestForCommandAsync<T>(message.Id);
var result = await _mediator.SendAsync(message.Command);
var result = await _mediator.Send(message.Command);
return result;
}


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Decorators/LogDecorator.cs View File

@ -6,7 +6,7 @@
public class LogDecorator<TRequest, TResponse>
: IAsyncRequestHandler<TRequest, TResponse>
where TRequest : IAsyncRequest<TResponse>
where TRequest : IRequest<TResponse>
{
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner;
private readonly ILogger<LogDecorator<TRequest, TResponse>> _logger;


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Decorators/ValidatorDecorator.cs View File

@ -10,7 +10,7 @@ namespace Ordering.API.Application.Decorators
{
public class ValidatorDecorator<TRequest, TResponse>
: IAsyncRequestHandler<TRequest, TResponse>
where TRequest : IAsyncRequest<TResponse>
where TRequest : IRequest<TResponse>
{
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner;
private readonly IValidator<TRequest>[] _validators;


+ 2
- 2
src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs View File

@ -34,13 +34,13 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
if (Guid.TryParse(requestId, out Guid guid) && guid != Guid.Empty)
{
var requestCreateOrder = new IdentifiedCommand<CreateOrderCommand, bool>(command, guid);
commandResult = await _mediator.SendAsync(requestCreateOrder);
commandResult = await _mediator.Send(requestCreateOrder);
}
else
{
// If no x-requestid header is found we process the order anyway. This is just temporary to not break existing clients
// that aren't still updated. When all clients were updated this could be removed.
commandResult = await _mediator.SendAsync(command);
commandResult = await _mediator.Send(command);
}
return commandResult ? (IActionResult)Ok() : (IActionResult)BadRequest();


+ 2
- 7
src/Services/Ordering/Ordering.API/Ordering.API.csproj View File

@ -2,13 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Ordering.API</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Ordering.API</PackageId>
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
@ -36,7 +31,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation.AspNetCore" Version="6.4.0" />
<PackageReference Include="FluentValidation.MVC6" Version="6.4.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="1.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
@ -56,7 +51,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.2" />
<PackageReference Include="MediatR" Version="2.1.0" />
<PackageReference Include="MediatR" Version="3.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="1.2.0" />


+ 1
- 4
src/Services/Ordering/Ordering.Domain/Events/BuyerPaymentMethodVerifiedDomainEvent.cs View File

@ -1,13 +1,10 @@
using MediatR;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
using System;
using System.Collections.Generic;
using System.Text;
namespace Ordering.Domain.Events
{
public class BuyerAndPaymentMethodVerifiedDomainEvent
: IAsyncNotification
: INotification
{
public Buyer Buyer { get; private set; }
public PaymentMethod Payment { get; private set; }


+ 1
- 1
src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs View File

@ -10,7 +10,7 @@ namespace Ordering.Domain.Events
/// Event used when an order is created
/// </summary>
public class OrderStartedDomainEvent
: IAsyncNotification
: INotification
{
public int CardTypeId { get; private set; }
public string CardNumber { get; private set; }


+ 2
- 2
src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj View File

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="2.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="1.1.0" />
<PackageReference Include="MediatR" Version="3.0.1" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="2.0.0" />
</ItemGroup>
</Project>

+ 6
- 6
src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs View File

@ -9,8 +9,8 @@
int? _requestedHashCode;
int _Id;
private List<IAsyncNotification> _domainEvents;
private List<INotification> _domainEvents;
public virtual int Id
{
@ -24,14 +24,14 @@
}
}
public List<IAsyncNotification> DomainEvents => _domainEvents;
public void AddDomainEvent(IAsyncNotification eventItem)
public List<INotification> DomainEvents => _domainEvents;
public void AddDomainEvent(INotification eventItem)
{
_domainEvents = _domainEvents ?? new List<IAsyncNotification>();
_domainEvents = _domainEvents ?? new List<INotification>();
_domainEvents.Add(eventItem);
}
public void RemoveDomainEvent(IAsyncNotification eventItem)
public void RemoveDomainEvent(INotification eventItem)
{
if (_domainEvents is null) return;
_domainEvents.Remove(eventItem);


+ 1
- 1
src/Services/Ordering/Ordering.Infrastructure/MediatorExtension.cs View File

@ -23,7 +23,7 @@ namespace Ordering.Infrastructure
var tasks = domainEvents
.Select(async (domainEvent) => {
await mediator.PublishAsync(domainEvent);
await mediator.Publish(domainEvent);
});
await Task.WhenAll(tasks);


+ 1
- 6
src/Web/WebMVC/WebMVC.csproj View File

@ -2,13 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>WebMVC</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>WebMVC</PackageId>
<UserSecretsId>aspnet-Microsoft.eShopOnContainers-946ae052-8305-4a99-965b-ec8636ddbae3</UserSecretsId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
@ -38,7 +33,7 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.1">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" />


+ 1
- 5
src/Web/WebSPA/WebSPA.csproj View File

@ -2,13 +2,9 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>WebSPA</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>eShopOnContainers.WebSPA</PackageId>
<UserSecretsId>aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<TypeScriptCompileOnSaveEnabled>false</TypeScriptCompileOnSaveEnabled>
@ -38,7 +34,7 @@
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Microsoft.AspNetCore.AngularServices" Version="1.0.0-beta-000014" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />


+ 0
- 1
src/Web/WebStatus/WebStatus.csproj View File

@ -4,7 +4,6 @@
</PropertyGroup>
<PropertyGroup>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>


+ 0
- 1
test/Services/FunctionalTests/FunctionalTests.csproj View File

@ -2,7 +2,6 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>


+ 0
- 1
test/Services/IntegrationTests/IntegrationTests.csproj View File

@ -5,7 +5,6 @@
<AssemblyName>IntegrationTests</AssemblyName>
<PackageId>FunctionalTests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>


+ 4
- 4
test/Services/UnitTest/Ordering/Application/IdentifierCommandHandlerTest.cs View File

@ -33,7 +33,7 @@ namespace UnitTest.Ordering.Application
_requestManager.Setup(x => x.ExistAsync(It.IsAny<Guid>()))
.Returns(Task.FromResult(false));
_mediator.Setup(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()))
_mediator.Setup(x => x.Send(It.IsAny<IRequest<bool>>(),default(System.Threading.CancellationToken)))
.Returns(Task.FromResult(true));
//Act
@ -42,7 +42,7 @@ namespace UnitTest.Ordering.Application
//Assert
Assert.True(result);
_mediator.Verify(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()), Times.Once());
_mediator.Verify(x => x.Send(It.IsAny<IRequest<bool>>(), default(System.Threading.CancellationToken)), Times.Once());
}
[Fact]
@ -55,7 +55,7 @@ namespace UnitTest.Ordering.Application
_requestManager.Setup(x => x.ExistAsync(It.IsAny<Guid>()))
.Returns(Task.FromResult(true));
_mediator.Setup(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()))
_mediator.Setup(x => x.Send(It.IsAny<IRequest<bool>>(), default(System.Threading.CancellationToken)))
.Returns(Task.FromResult(true));
//Act
@ -64,7 +64,7 @@ namespace UnitTest.Ordering.Application
//Assert
Assert.False(result);
_mediator.Verify(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()), Times.Never());
_mediator.Verify(x => x.Send(It.IsAny<IRequest<bool>>(), default(System.Threading.CancellationToken)), Times.Never());
}
private CreateOrderCommand FakeOrderRequest(Dictionary<string, object> args = null)


+ 2
- 2
test/Services/UnitTest/Ordering/Application/OrdersWebApiTest.cs View File

@ -29,7 +29,7 @@ namespace UnitTest.Ordering.Application
public async Task Create_order_with_requestId_success()
{
//Arrange
_mediatorMock.Setup(x => x.SendAsync(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>()))
_mediatorMock.Setup(x => x.Send(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>(), default(System.Threading.CancellationToken)))
.Returns(Task.FromResult(true));
//Act
@ -45,7 +45,7 @@ namespace UnitTest.Ordering.Application
public async Task Create_order_bad_request()
{
//Arrange
_mediatorMock.Setup(x => x.SendAsync(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>()))
_mediatorMock.Setup(x => x.Send(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>(), default(System.Threading.CancellationToken)))
.Returns(Task.FromResult(true));
//Act


+ 1
- 4
test/Services/UnitTest/UnitTest.csproj View File

@ -2,10 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<AssemblyName>UnitTest</AssemblyName>
<PackageId>UnitTest</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
@ -25,7 +22,7 @@
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="MediatR" Version="2.1.0" />
<PackageReference Include="MediatR" Version="3.0.1" />
<PackageReference Include="Moq" Version="4.7.10" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />


Loading…
Cancel
Save