fix tests
This commit is contained in:
parent
af23ef3f13
commit
547b5cd59e
@ -7,14 +7,4 @@ namespace ELT.Client.Managers
|
|||||||
public string Login { get; set; }
|
public string Login { get; set; }
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BaseManager
|
|
||||||
{
|
|
||||||
protected AuthInfo AuthInfo =>
|
|
||||||
new AuthInfo
|
|
||||||
{
|
|
||||||
Login = Environment.GetEnvironmentVariable("eltLogin"),
|
|
||||||
Password = Environment.GetEnvironmentVariable("eltPassword")
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -43,13 +43,13 @@ namespace ELT.Client.Managers.Insurance
|
|||||||
, null
|
, null
|
||||||
, null
|
, null
|
||||||
, null
|
, null
|
||||||
, "15"
|
, "13"
|
||||||
, null
|
, null
|
||||||
, false
|
, false
|
||||||
, null
|
, null
|
||||||
, null
|
, null
|
||||||
, kaskoParams);
|
, kaskoParams);
|
||||||
if (string.IsNullOrEmpty(res.Error))
|
//if (string.IsNullOrEmpty(res.Error))
|
||||||
result.Add(companyId, res);
|
result.Add(companyId, res);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using ELT.Client.Models.Insurance;
|
using ELT.Client.Models.Insurance;
|
||||||
using ELT.Client.Models.Insurance.Request;
|
using ELT.Client.Models.Insurance.Request;
|
||||||
using ELTKasko;
|
using ELTKasko;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ELT.Tests.Controllers.InsuranceController
|
namespace ELT.Tests.Controllers.InsuranceController
|
||||||
@ -13,9 +12,10 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void Test1()
|
public void Test1()
|
||||||
{
|
{
|
||||||
|
var TARGET_INSURANCE_COMPANY = "INGOS";
|
||||||
var request = new CalculateKaskoRequest
|
var request = new CalculateKaskoRequest
|
||||||
{
|
{
|
||||||
CompanyIds = new[] {"INGOS"},
|
CompanyIds = new[] { TARGET_INSURANCE_COMPANY },
|
||||||
Preparams = new Preparams
|
Preparams = new Preparams
|
||||||
{
|
{
|
||||||
RegionName = "Рязанская обл",
|
RegionName = "Рязанская обл",
|
||||||
@ -48,6 +48,8 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
{
|
{
|
||||||
Category = "B"
|
Category = "B"
|
||||||
},
|
},
|
||||||
|
DriversCount = 0,
|
||||||
|
Risk = 0,
|
||||||
Drivers = new[]
|
Drivers = new[]
|
||||||
{
|
{
|
||||||
new Driver
|
new Driver
|
||||||
@ -63,6 +65,17 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Lessee = new PhysicalPerson
|
Lessee = new PhysicalPerson
|
||||||
{
|
{
|
||||||
INN = "7727563778",
|
INN = "7727563778",
|
||||||
|
SubjectTypeSpecified = true,
|
||||||
|
SubjectType = 1
|
||||||
|
},
|
||||||
|
Owner = new PhysicalPerson
|
||||||
|
{
|
||||||
|
SubjectTypeSpecified = true,
|
||||||
|
SubjectType = 1
|
||||||
|
},
|
||||||
|
Insurer = new PhysicalPerson
|
||||||
|
{
|
||||||
|
|
||||||
SubjectTypeSpecified = true,
|
SubjectTypeSpecified = true,
|
||||||
SubjectType = 1
|
SubjectType = 1
|
||||||
}
|
}
|
||||||
@ -73,16 +86,16 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Dictionary<string, KASKOCalculationResult> res
|
Dictionary<string, KASKOCalculationResult> res
|
||||||
= insuranceController.CalculateKasko(request).Value;
|
= insuranceController.CalculateKasko(request).Value;
|
||||||
Assert.True(res.Count > 0);
|
Assert.True(res.Count > 0);
|
||||||
Assert.NotNull(res["INGOS"]);
|
Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId);
|
||||||
Assert.Null(res["INGOS"].Error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Test2()
|
public void Test2()
|
||||||
{
|
{
|
||||||
|
var TARGET_INSURANCE_COMPANY = "VSK";
|
||||||
var request = new CalculateKaskoRequest
|
var request = new CalculateKaskoRequest
|
||||||
{
|
{
|
||||||
CompanyIds = new[] {"VSK"},
|
CompanyIds = new[] { TARGET_INSURANCE_COMPANY },
|
||||||
Preparams = new Preparams
|
Preparams = new Preparams
|
||||||
{
|
{
|
||||||
RegionName = "г.Москва",
|
RegionName = "г.Москва",
|
||||||
@ -116,6 +129,8 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Category = "B",
|
Category = "B",
|
||||||
Mileage = 50000
|
Mileage = 50000
|
||||||
},
|
},
|
||||||
|
DriversCount = 0,
|
||||||
|
Risk = 0,
|
||||||
Drivers = new[]
|
Drivers = new[]
|
||||||
{
|
{
|
||||||
new Driver
|
new Driver
|
||||||
@ -131,6 +146,17 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Lessee = new PhysicalPerson
|
Lessee = new PhysicalPerson
|
||||||
{
|
{
|
||||||
INN = "7727563778",
|
INN = "7727563778",
|
||||||
|
SubjectTypeSpecified = true,
|
||||||
|
SubjectType = 1
|
||||||
|
},
|
||||||
|
Owner = new PhysicalPerson
|
||||||
|
{
|
||||||
|
SubjectTypeSpecified = true,
|
||||||
|
SubjectType = 1
|
||||||
|
},
|
||||||
|
Insurer = new PhysicalPerson
|
||||||
|
{
|
||||||
|
|
||||||
SubjectTypeSpecified = true,
|
SubjectTypeSpecified = true,
|
||||||
SubjectType = 1
|
SubjectType = 1
|
||||||
}
|
}
|
||||||
@ -141,16 +167,16 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Dictionary<string, KASKOCalculationResult> res
|
Dictionary<string, KASKOCalculationResult> res
|
||||||
= insuranceController.CalculateKasko(request).Value;
|
= insuranceController.CalculateKasko(request).Value;
|
||||||
Assert.True(res.Count > 0);
|
Assert.True(res.Count > 0);
|
||||||
Assert.NotNull(res["INGOS"]);
|
Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId);
|
||||||
Assert.Null(res["INGOS"].Error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Test3()
|
public void Test3()
|
||||||
{
|
{
|
||||||
|
var TARGET_INSURANCE_COMPANY = "RESO_GARANTIJA";
|
||||||
var request = new CalculateKaskoRequest
|
var request = new CalculateKaskoRequest
|
||||||
{
|
{
|
||||||
CompanyIds = new[] {"VSK"},
|
CompanyIds = new[] { TARGET_INSURANCE_COMPANY },
|
||||||
Preparams = new Preparams
|
Preparams = new Preparams
|
||||||
{
|
{
|
||||||
RegionName = "г.Москва",
|
RegionName = "г.Москва",
|
||||||
@ -173,6 +199,7 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
KPPTypeId = 1,
|
KPPTypeId = 1,
|
||||||
BodyType = 9
|
BodyType = 9
|
||||||
},
|
},
|
||||||
|
Risk = 0,
|
||||||
BankId = "245",
|
BankId = "245",
|
||||||
Duration = 24,
|
Duration = 24,
|
||||||
Cost = 2000000,
|
Cost = 2000000,
|
||||||
@ -183,6 +210,7 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
{
|
{
|
||||||
Category = "B"
|
Category = "B"
|
||||||
},
|
},
|
||||||
|
DriversCount = 0,
|
||||||
Drivers = new[]
|
Drivers = new[]
|
||||||
{
|
{
|
||||||
new Driver
|
new Driver
|
||||||
@ -198,6 +226,17 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Lessee = new PhysicalPerson
|
Lessee = new PhysicalPerson
|
||||||
{
|
{
|
||||||
INN = "7727563778",
|
INN = "7727563778",
|
||||||
|
SubjectTypeSpecified = true,
|
||||||
|
SubjectType = 1
|
||||||
|
},
|
||||||
|
Owner = new PhysicalPerson
|
||||||
|
{
|
||||||
|
SubjectTypeSpecified = true,
|
||||||
|
SubjectType = 1
|
||||||
|
},
|
||||||
|
Insurer = new PhysicalPerson
|
||||||
|
{
|
||||||
|
|
||||||
SubjectTypeSpecified = true,
|
SubjectTypeSpecified = true,
|
||||||
SubjectType = 1
|
SubjectType = 1
|
||||||
}
|
}
|
||||||
@ -208,8 +247,7 @@ namespace ELT.Tests.Controllers.InsuranceController
|
|||||||
Dictionary<string, KASKOCalculationResult> res
|
Dictionary<string, KASKOCalculationResult> res
|
||||||
= insuranceController.CalculateKasko(request).Value;
|
= insuranceController.CalculateKasko(request).Value;
|
||||||
Assert.True(res.Count > 0);
|
Assert.True(res.Count > 0);
|
||||||
Assert.NotNull(res["INGOS"]);
|
Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId);
|
||||||
Assert.Null(res["INGOS"].Error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
21
ELT.Tests/ELT.Tests.csproj
Normal file
21
ELT.Tests/ELT.Tests.csproj
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||||
|
<PackageReference Include="xunit" Version="2.4.0" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="1.2.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ELT.Client\ELT.Client.csproj" />
|
||||||
|
<ProjectReference Include="..\ELT\ELT.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
12
ELT.sln
12
ELT.sln
@ -5,9 +5,9 @@ VisualStudioVersion = 16.0.31005.135
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ELT", "ELT\ELT.csproj", "{2DB25D88-2DC4-4923-B26D-BE9D4FE03463}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ELT", "ELT\ELT.csproj", "{2DB25D88-2DC4-4923-B26D-BE9D4FE03463}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ELT.Client", "ELT.Client\ELT.Client.csproj", "{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ELT.Client", "ELT.Client\ELT.Client.csproj", "{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ELT.Tests", "ELT.Tests\ELT.Tests.csproj", "{CADD0507-132B-4FDC-81B2-3415A372FFA3}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ELT.Tests", "ELT.Tests\ELT.Tests.csproj", "{F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -23,10 +23,10 @@ Global
|
|||||||
{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}.Release|Any CPU.Build.0 = Release|Any CPU
|
{9EC7C85B-FC9C-4BCE-A587-CB3B75AEE554}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{CADD0507-132B-4FDC-81B2-3415A372FFA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{CADD0507-132B-4FDC-81B2-3415A372FFA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{CADD0507-132B-4FDC-81B2-3415A372FFA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{CADD0507-132B-4FDC-81B2-3415A372FFA3}.Release|Any CPU.Build.0 = Release|Any CPU
|
{F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user