diff --git a/ELT.Client/Managers/BaseManager.cs b/ELT.Client/Managers/BaseManager.cs index 1448c98..9b2dead 100644 --- a/ELT.Client/Managers/BaseManager.cs +++ b/ELT.Client/Managers/BaseManager.cs @@ -7,14 +7,4 @@ namespace ELT.Client.Managers public string Login { get; set; } public string Password { get; set; } } - - public class BaseManager - { - protected AuthInfo AuthInfo => - new AuthInfo - { - Login = Environment.GetEnvironmentVariable("eltLogin"), - Password = Environment.GetEnvironmentVariable("eltPassword") - }; - } } \ No newline at end of file diff --git a/ELT.Client/Managers/Insurance/KaskoManager.cs b/ELT.Client/Managers/Insurance/KaskoManager.cs index d35e146..e37dfc5 100644 --- a/ELT.Client/Managers/Insurance/KaskoManager.cs +++ b/ELT.Client/Managers/Insurance/KaskoManager.cs @@ -43,13 +43,13 @@ namespace ELT.Client.Managers.Insurance , null , null , null - , "15" + , "13" , null , false , null , null , kaskoParams); - if (string.IsNullOrEmpty(res.Error)) + //if (string.IsNullOrEmpty(res.Error)) result.Add(companyId, res); })); diff --git a/ELT.Tests/Controllers/InsuranceController/Kasko.cs b/ELT.Tests/Controllers/InsuranceController/Kasko.cs index 886028b..6f51cde 100644 --- a/ELT.Tests/Controllers/InsuranceController/Kasko.cs +++ b/ELT.Tests/Controllers/InsuranceController/Kasko.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using ELT.Client.Models.Insurance; using ELT.Client.Models.Insurance.Request; using ELTKasko; -using Microsoft.AspNetCore.Mvc; using Xunit; namespace ELT.Tests.Controllers.InsuranceController @@ -13,9 +12,10 @@ namespace ELT.Tests.Controllers.InsuranceController [Fact] public void Test1() { + var TARGET_INSURANCE_COMPANY = "INGOS"; var request = new CalculateKaskoRequest { - CompanyIds = new[] {"INGOS"}, + CompanyIds = new[] { TARGET_INSURANCE_COMPANY }, Preparams = new Preparams { RegionName = "Рязанская обл", @@ -48,6 +48,8 @@ namespace ELT.Tests.Controllers.InsuranceController { Category = "B" }, + DriversCount = 0, + Risk = 0, Drivers = new[] { new Driver @@ -63,6 +65,17 @@ namespace ELT.Tests.Controllers.InsuranceController Lessee = new PhysicalPerson { INN = "7727563778", + SubjectTypeSpecified = true, + SubjectType = 1 + }, + Owner = new PhysicalPerson + { + SubjectTypeSpecified = true, + SubjectType = 1 + }, + Insurer = new PhysicalPerson + { + SubjectTypeSpecified = true, SubjectType = 1 } @@ -73,16 +86,16 @@ namespace ELT.Tests.Controllers.InsuranceController Dictionary res = insuranceController.CalculateKasko(request).Value; Assert.True(res.Count > 0); - Assert.NotNull(res["INGOS"]); - Assert.Null(res["INGOS"].Error); + Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId); } [Fact] public void Test2() { + var TARGET_INSURANCE_COMPANY = "VSK"; var request = new CalculateKaskoRequest { - CompanyIds = new[] {"VSK"}, + CompanyIds = new[] { TARGET_INSURANCE_COMPANY }, Preparams = new Preparams { RegionName = "г.Москва", @@ -116,6 +129,8 @@ namespace ELT.Tests.Controllers.InsuranceController Category = "B", Mileage = 50000 }, + DriversCount = 0, + Risk = 0, Drivers = new[] { new Driver @@ -131,6 +146,17 @@ namespace ELT.Tests.Controllers.InsuranceController Lessee = new PhysicalPerson { INN = "7727563778", + SubjectTypeSpecified = true, + SubjectType = 1 + }, + Owner = new PhysicalPerson + { + SubjectTypeSpecified = true, + SubjectType = 1 + }, + Insurer = new PhysicalPerson + { + SubjectTypeSpecified = true, SubjectType = 1 } @@ -141,16 +167,16 @@ namespace ELT.Tests.Controllers.InsuranceController Dictionary res = insuranceController.CalculateKasko(request).Value; Assert.True(res.Count > 0); - Assert.NotNull(res["INGOS"]); - Assert.Null(res["INGOS"].Error); + Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId); } [Fact] public void Test3() { + var TARGET_INSURANCE_COMPANY = "RESO_GARANTIJA"; var request = new CalculateKaskoRequest { - CompanyIds = new[] {"VSK"}, + CompanyIds = new[] { TARGET_INSURANCE_COMPANY }, Preparams = new Preparams { RegionName = "г.Москва", @@ -173,6 +199,7 @@ namespace ELT.Tests.Controllers.InsuranceController KPPTypeId = 1, BodyType = 9 }, + Risk = 0, BankId = "245", Duration = 24, Cost = 2000000, @@ -183,6 +210,7 @@ namespace ELT.Tests.Controllers.InsuranceController { Category = "B" }, + DriversCount = 0, Drivers = new[] { new Driver @@ -198,6 +226,17 @@ namespace ELT.Tests.Controllers.InsuranceController Lessee = new PhysicalPerson { INN = "7727563778", + SubjectTypeSpecified = true, + SubjectType = 1 + }, + Owner = new PhysicalPerson + { + SubjectTypeSpecified = true, + SubjectType = 1 + }, + Insurer = new PhysicalPerson + { + SubjectTypeSpecified = true, SubjectType = 1 } @@ -208,8 +247,7 @@ namespace ELT.Tests.Controllers.InsuranceController Dictionary res = insuranceController.CalculateKasko(request).Value; Assert.True(res.Count > 0); - Assert.NotNull(res["INGOS"]); - Assert.Null(res["INGOS"].Error); + Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId); } } } \ No newline at end of file diff --git a/ELT.Tests/ELT.Tests.csproj b/ELT.Tests/ELT.Tests.csproj new file mode 100644 index 0000000..1425966 --- /dev/null +++ b/ELT.Tests/ELT.Tests.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + + diff --git a/ELT.sln b/ELT.sln index 6d66d4e..03a47a9 100644 --- a/ELT.sln +++ b/ELT.sln @@ -5,9 +5,9 @@ VisualStudioVersion = 16.0.31005.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ELT", "ELT\ELT.csproj", "{2DB25D88-2DC4-4923-B26D-BE9D4FE03463}" 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 -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 Global 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}.Release|Any CPU.ActiveCfg = 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 - {CADD0507-132B-4FDC-81B2-3415A372FFA3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CADD0507-132B-4FDC-81B2-3415A372FFA3}.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}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F86CEFE3-5F4A-4666-94E9-2BB37C83A9CB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE