Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ indent_style = space
charset = utf-8-bom
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 180
max_line_length = 160

# Microsoft .NET properties
csharp_preserve_single_line_blocks = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
8 changes: 4 additions & 4 deletions src/Application/Framework.Application.Tests/PeriodTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public void GetFinancialYear_MonthOutOfRange_ThrowArgumentOutOfRangeException(in
var service = new FinancialYearCalculator(new FinancialYearServiceSettings());

// Act
Action action = () => service.GetFinancialYear(2017, month);
var ex = Record.Exception(() => service.GetFinancialYear(2017, month));

// Assert
Assert.Throws<ArgumentOutOfRangeException>(action);
Assert.IsType<ArgumentOutOfRangeException>(ex);
}

/// <summary>
Expand All @@ -61,9 +61,9 @@ public void GetFinancialYear_YearOutOfRange_ThrowArgumentOutOfRangeException(int
var service = new FinancialYearCalculator(new FinancialYearServiceSettings());

// Act
Action action = () => service.GetFinancialYear(year, month);
var ex = Record.Exception(() => service.GetFinancialYear(year, month));

// Assert
Assert.Throws<ArgumentOutOfRangeException>(action);
Assert.IsType<ArgumentOutOfRangeException>(ex);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageId>Luxoft.Framework.AutomationCore.ServiceEnvironment.LegacyContext</PackageId>
<PackageId>Luxoft.Framework.AutomationCore.Legacy</PackageId>
<RootNamespace>Framework.AutomationCore</RootNamespace>
</PropertyGroup>

Expand All @@ -15,7 +15,7 @@

<ProjectReference Include="..\..\_Authorization\Framework.Authorization.WebApi\Framework.Authorization.WebApi.csproj" />

<ProjectReference Include="..\Framework.AutomationCore.ServiceEnvironment\Framework.AutomationCore.ServiceEnvironment.csproj" />
<ProjectReference Include="..\Framework.AutomationCore\Framework.AutomationCore.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Framework.Application;
using Framework.Application.Repository;
using Framework.AutomationCore.RootServiceProviderContainer;
using Framework.AutomationCore.ServiceProviderPool;
using Framework.BLL.DTOMapping.Domain;
using Framework.Configuration.BLL;
using Framework.Configuration.Domain;
Expand All @@ -18,23 +17,22 @@

namespace Framework.AutomationCore;

public abstract class IntegrationTestBase<TBLLContext>(IServiceProviderPool rootServiceProviderPool)
: IntegrationTestBase(rootServiceProviderPool), IRootServiceProviderContainer<TBLLContext>
public abstract class IntegrationTestBase<TBLLContext>(IServiceProvider rootServiceProvider) : RootServiceProviderContainer<TBLLContext>(rootServiceProvider)
where TBLLContext : IServiceProviderContainer
{
public Task<TResult> EvaluateAsync<TResult>(
DBSessionMode sessionMode,
UserCredential? customUserCredential,
Func<TBLLContext, Task<TResult>> getResult) =>
this.RootServiceProvider.GetRequiredService<IServiceEvaluator<TBLLContext>>().EvaluateAsync(sessionMode, customUserCredential, getResult);
rootServiceProvider.GetRequiredService<IServiceEvaluator<TBLLContext>>().EvaluateAsync(sessionMode, customUserCredential, getResult);


protected IConfigurationBLLContext GetConfigurationBLLContext(TBLLContext context) => context.ServiceProvider.GetRequiredService<IConfigurationBLLContext>();

/// <summary>
/// Отчистка списка нотифицаций
/// </summary>
public override void ClearNotifications() =>
public virtual void ClearNotifications() =>
this.EvaluateWrite(context => this.GetConfigurationBLLContext(context).Logics.DomainObjectNotification.Pipe(bll => bll.GetFullList().ForEach(bll.Remove)));

/// <summary>
Expand All @@ -46,12 +44,12 @@ protected virtual List<ObjectModificationInfoDTO<Guid>> GetModifications() =>

this.GetConfigurationBLLContext(context).Logics.DomainObjectModification.GetFullList()
.ToList(mod => new ObjectModificationInfoDTO<Guid>
{
Identity = mod.DomainObjectId,
ModificationType = mod.Type,
Revision = mod.Revision,
TypeInfoDescription = new TypeInfoDescriptionDTO { Name = mod.DomainType.Name, Namespace = mod.DomainType.Namespace }
}));
{
Identity = mod.DomainObjectId,
ModificationType = mod.Type,
Revision = mod.Revision,
TypeInfoDescription = new TypeInfoDescriptionDTO { Name = mod.DomainType.Name, Namespace = mod.DomainType.Namespace }
}));

/// <summary>
/// Отчистка списка модификаций
Expand All @@ -62,7 +60,7 @@ protected virtual void ClearModifications() =>
/// <summary>
/// Отчистка интеграционных евентов
/// </summary>
public override void ClearIntegrationEvents()
public virtual void ClearIntegrationEvents()
{
this.ClearModifications();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Framework.AutomationCore.RootServiceProviderContainer;

public class RootServiceProviderContainer<TBLLContext>(IServiceProvider rootServiceProvider) : RootServiceProviderContainer(rootServiceProvider), IRootServiceProviderContainer<TBLLContext>;

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading