using System; using System.Collections.Generic; using ELT.Client.Models.Insurance; using ELT.Client.Models.Insurance.Request; using ELTKasko; using Xunit; namespace ELT.Tests.Controllers.InsuranceController { public class Kasko { [Fact] public void Test1() { var TARGET_INSURANCE_COMPANY = "INGOS"; var request = new CalculateKaskoRequest { CompanyIds = new[] { TARGET_INSURANCE_COMPANY }, Preparams = new Preparams { Kladr = "6200000100000", BrandId = "C3B16998-C04D-484C-A17E-DB2C8FFE6DF3", ModelId = "29DF0E37-1431-4037-AC0A-0FCA37AD0792" }, ELTParams = new PreliminaryKASKOCalculationParams { Currency = "RUR", IsNew = true, UsageStart = new DateTime(2021, 04, 16), UsageCityKLADR = "6200000100000", VehicleYear = 2021, Mark = "AUDI", Model = "A4", Modification = new Modification { Power = 160, KPPTypeId = 1, BodyType = 9 }, BankId = "245", Duration = 24, Cost = 2000000, SSType = "1", STOA = "0", OfficialDealer = true, Vehicle = new VehicleParams { Category = "B" }, DriversCount = 0, Risk = 0, Drivers = new[] { new Driver { Age = 18, Experience = 0 } }, NS = new NSType { LimitSum = "1000000" }, Lessee = new PhysicalPerson { INN = "7727563778", SubjectTypeSpecified = true, SubjectType = 1 }, Owner = new PhysicalPerson { SubjectTypeSpecified = true, SubjectType = 1 }, Insurer = new PhysicalPerson { SubjectTypeSpecified = true, SubjectType = 1 } } }; var insuranceController = new ELT.Controllers.InsuranceController(); Dictionary res = insuranceController.CalculateKasko(request).Value; Assert.True(res.Count > 0); Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId); } [Fact] public void Test2() { var TARGET_INSURANCE_COMPANY = "VSK"; var request = new CalculateKaskoRequest { CompanyIds = new[] { TARGET_INSURANCE_COMPANY }, Preparams = new Preparams { Kladr = "7700000000000", BrandId = "35CCC6D8-BE9F-49AE-983F-9DDB936A2672", ModelId = "90642EC2-6A52-44B0-8238-3A26AFF84514" }, ELTParams = new PreliminaryKASKOCalculationParams { Currency = "RUR", IsNew = true, UsageStart = new DateTime(2021, 04, 16), UsageCityKLADR = "7700000000000", VehicleYear = 2021, Mark = "KIA", Model = "RIO", Modification = new Modification { Power = 160, KPPTypeId = 1, BodyType = 9 }, BankId = "245", Duration = 36, Cost = 2000000, SSType = "1", STOA = "0", OfficialDealer = true, Vehicle = new VehicleParams { Category = "B", Mileage = 50000 }, DriversCount = 0, Risk = 0, Drivers = new[] { new Driver { Age = 18, Experience = 0 } }, NS = new NSType { LimitSum = "1000000" }, Lessee = new PhysicalPerson { INN = "7727563778", SubjectTypeSpecified = true, SubjectType = 1 }, Owner = new PhysicalPerson { SubjectTypeSpecified = true, SubjectType = 1 }, Insurer = new PhysicalPerson { SubjectTypeSpecified = true, SubjectType = 1 } } }; var insuranceController = new ELT.Controllers.InsuranceController(); Dictionary res = insuranceController.CalculateKasko(request).Value; Assert.True(res.Count > 0); Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId); } [Fact] public void Test3() { var TARGET_INSURANCE_COMPANY = "RESO_GARANTIJA"; var request = new CalculateKaskoRequest { CompanyIds = new[] { TARGET_INSURANCE_COMPANY }, Preparams = new Preparams { Kladr = "7700000000000", BrandId = "1204F109-AF5C-45E1-A587-0664F16AB00D", ModelId = "78F317BB-633B-4C75-86B6-436ABE43A40E" }, ELTParams = new PreliminaryKASKOCalculationParams { Currency = "RUR", IsNew = true, UsageStart = new DateTime(2021, 04, 16), UsageCityKLADR = "7700000000000", VehicleYear = 2021, Mark = "Jeep", Model = "Wrangler", Modification = new Modification { Power = 230, KPPTypeId = 1, BodyType = 9 }, Risk = 0, BankId = "245", Duration = 24, Cost = 2000000, SSType = "1", STOA = "0", OfficialDealer = true, Vehicle = new VehicleParams { Category = "B" }, DriversCount = 0, Drivers = new[] { new Driver { Age = 18, Experience = 0 } }, NS = new NSType { LimitSum = "1000000" }, Lessee = new PhysicalPerson { INN = "7727563778", SubjectTypeSpecified = true, SubjectType = 1 }, Owner = new PhysicalPerson { SubjectTypeSpecified = true, SubjectType = 1 }, Insurer = new PhysicalPerson { SubjectTypeSpecified = true, SubjectType = 1 } } }; var insuranceController = new ELT.Controllers.InsuranceController(); Dictionary res = insuranceController.CalculateKasko(request).Value; Assert.True(res.Count > 0); Assert.NotNull(res[TARGET_INSURANCE_COMPANY].RequestId); } } }