public void GetDetails_Test() { //Arrange IInsuranceService service = InsuranceFactory.GetInsuranceObj(); int age = 25; double sum = 50000; Details expected = new Details(); expected.Age = age; expected.Sum = sum; expected.RiskPremium = 0.82; expected.RenewalCommision = 0.02; expected.NetPremium = 0.84; expected.InitialCommission = 1.72; expected.GrossPremium = 2.56; expected.Notes = "Successfully return a premium"; Details actual = new Details(); actual.Age = age; actual.Sum = sum; //Act actual = service.GetDetails(actual); //Assert Assert.AreEqual(expected.RiskPremium, actual.RiskPremium); Assert.AreEqual(expected.GrossPremium, actual.GrossPremium); }
public VehicleController(dbContext context, IMessageService messageService, IInsuranceService insuranceService) { _messageService = messageService; _context = context; _insuranceService = insuranceService; }
public CarsController(ICarService carService, IInsuranceService insuranceService, ICarInsuranceRepo carInsuranceRepo, ICarBrandRepo carBrandRepo)//constuctor injection { _carService = carService; _insuranceService = insuranceService; _carInsuranceRepo = carInsuranceRepo; _carBrandRepo = carBrandRepo; }
public InsuranceServiceTests() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: "TestDb").Options; this.connection = new ApplicationDbContext(options); this.insuranceRepository = new EfRepository <Insurance>(this.connection); this.insuranceService = new InsuranceService(this.insuranceRepository); }
public InsuranceController(IInsuranceTypeService insuranceTypeService, IInsuranceService insuranceService, ICompanyService companyService, ICompanyLogService companyLogService) { this.insuranceTypeService = insuranceTypeService; this.insuranceService = insuranceService; this.companyService = companyService; this.companyLogService = companyLogService; }
public PayController(IPaymentRecordService paymentRecordService, IEmployeeService employeeService, ITaxService taxService, IInsuranceService insuranceService) { _paymentRecordService = paymentRecordService; _employeeService = employeeService; _taxService = taxService; _insuranceService = insuranceService; }
public PersonController(IPersonService personService, IEducationService educationService, IPassportService passportService, IInsuranceService insuranceService, IPositionService positionService, IPersonPositionService personPositionService, IMapper mapper) { this._personService = personService; this._educationService = educationService; this._insuranceService = insuranceService; this._passportService = passportService; this._positionService = positionService; this._personPositionService = personPositionService; this._mapper = mapper; }
public PatientsController(IPatientService patientService, IStateService stateService, IPracticeService practiceService, INPIService npiService, IPayerService payerService, IInsuranceService insuranceService) { _patientService = patientService; _stateService = stateService; _practiceService = practiceService; _npiService = npiService; _payerService = payerService; _insuranceService = insuranceService; }
public EmployeeController(UserManager<ApplicationUser> UserManager, IExperienceService experienceService, ISalaryService salaryService, IEmployeeService employeeService, ICompanyService companyService, ITerminateService terminateService, IPositionService positionService, IContractService contractService, IInsuranceService insuranceService) { this.employeeService = employeeService; this.companyService = companyService; this.terminateService = terminateService; this.positionService = positionService; this.contractService = contractService; this.insuranceService = insuranceService; this.salaryService = salaryService; this.experienceService = experienceService; this.userManager = UserManager; }
public void GetDetails_InvalidSum() { //Arrange IInsuranceService service = InsuranceFactory.GetInsuranceObj(); string expected = "Unable to provide premium"; Details actual = new Details(); actual.Age = 62; actual.Sum = 350000; //Act actual = service.GetDetails(actual); //Assert Assert.AreEqual(expected, actual.Notes); }
public void GetDetails_InvalidAge() { //Arrange IInsuranceService service = InsuranceFactory.GetInsuranceObj(); string expected = "Invalid Age. Age Range is 18 - 65"; Details actual = new Details(); actual.Age = 16; actual.Sum = 25000; //Act actual = service.GetDetails(actual); //Assert Assert.AreEqual(expected, actual.Notes); }
public IHttpActionResult GetInsurance([FromBody] Details details) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { IInsuranceService insuranceService = InsuranceFactory.GetInsuranceObj(); details = insuranceService.GetDetails(details); return(Ok(details)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ContentLimitItemsController(IInsuranceService insuranceService, IMapper mapper) { _insuranceService = insuranceService; _mapper = mapper; }
public InsuranceApiController(IServiceProvider serviceProvider) : base(serviceProvider) { _insuranceService = _serviceProvider.GetService <IInsuranceService>(); _metadataContext = _serviceProvider.GetService <IDbMetadataContext>(); }
public CarsController(ICarService carService, IInsuranceService insuranceService) { _carService = carService; _insuranceService = insuranceService; }
public InsurencesController(IInsuranceService insuranceService) { _insuranceService = insuranceService; }
public ReactController(ICarService carService, IInsuranceService insuranceService, ISaleService saleService) { _carService = carService; _insuranceService = insuranceService; _saleService = saleService; }
public PoliciesController(IInsuranceService insuranceService) { this.insuranceService = insuranceService ?? throw new ArgumentNullException(nameof(insuranceService)); }
public InsuranceController(IInsuranceService insuranceService, IInsuranceServiceService insuranceServiceService) { _insuranceService = insuranceService; _insuranceServiceService = insuranceServiceService; }
public static async System.Threading.Tasks.Task InitializeDataAsync(RoleManager <ApplicationRole> roleManager, UserManager <ApplicationUser> userManager, IPersonService personService, IPositionService positionService, IPersonPositionService personPositionService, IEducationService educationService, IInsuranceService insuranceService, IPassportService passportService) { #region Roles var existRole = await roleManager.FindByNameAsync("Admin"); if (existRole == null) { string[] roleNames = { "Admin", "WriteAndRead", "Read" }; foreach (string roleName in roleNames) { await roleManager.CreateAsync(new ApplicationRole(roleName)); } } #endregion #region User var existUser = await userManager.FindByNameAsync("Admin"); if (existUser == null) { var admin = new ApplicationUser { UserName = "******", Email = "*****@*****.**", IsDeleted = false }; var createdAdmin = await userManager.CreateAsync(admin, "Admin1;"); if (createdAdmin.Succeeded) { await userManager.AddToRoleAsync(admin, "Admin"); } var writeAndreadUser = new ApplicationUser { UserName = "******", Email = "*****@*****.**", IsDeleted = false }; var createdWriter = await userManager.CreateAsync(writeAndreadUser, "Writer1;"); if (createdWriter.Succeeded) { await userManager.AddToRoleAsync(writeAndreadUser, "WriteAndRead"); } var readUser = new ApplicationUser { UserName = "******", Email = "*****@*****.**", IsDeleted = false }; var createdReader = await userManager.CreateAsync(readUser, "Reader1;"); if (createdReader.Succeeded) { await userManager.AddToRoleAsync(readUser, "Read"); } } #endregion if (!personService.GetPersons().Any()) { #region Person IList <Person> persons = new List <Person>() { new Person { LastName = "Михаилович", FirstName = "Михаил", MiddleName = "Михайлович", Gender = DAL.Gender.Мужской, INN = "85464586458", SNILS = "9392149239" }, new Person { LastName = "Васильева", FirstName = "Василиса", MiddleName = "Васюткина", Gender = DAL.Gender.Женский, INN = "228", SNILS = "322" }, new Person { LastName = "Петров", FirstName = "Петя", MiddleName = "Петрович", Gender = DAL.Gender.Мужской, INN = "549593", SNILS = "483943" }, new Person { LastName = "Алексеев", FirstName = "Алеша", MiddleName = "Михайлович", Gender = DAL.Gender.Мужской, INN = "9549", SNILS = "954394" }, new Person { LastName = "Кекмен", FirstName = "Татьяна", MiddleName = "Васюткина", Gender = DAL.Gender.Женский, INN = "22823", SNILS = "3222342" }, new Person { LastName = "Жульбарс", FirstName = "Петя", MiddleName = "Петрович", Gender = DAL.Gender.Мужской, INN = "45636", SNILS = "34534" } }; foreach (var person in persons) { personService.CreatePerson(person); } #endregion #region Position var positions = new Position[] { new Position { Name = "Директор" }, new Position { Name = "Инженер" }, new Position { Name = "Бухгалтер" } }; foreach (var position in positions) { positionService.CreatePosition(position); } #endregion #region PersonPosition persons = personService.GetPersons().ToList(); positions = positionService.GetAllPosition().ToArray(); Random rnd = new Random(); foreach (var person in persons) { personPositionService.AddPersonPosition(new PersonPosition { PersonId = person.Id, PositionId = positions[rnd.Next(0, 3)].Id }); } #endregion #region Passport var passports = new Passport[] { new Passport { PersonId = persons[0].Id, Series = rnd.Next(100000, 999999).ToString(), Number = rnd.Next(1000, 9999).ToString(), Address = "Алтайский район", DateOfGive = DateTime.Today, GivenBy = "Отделом УФМС" }, new Passport { PersonId = persons[1].Id, Series = rnd.Next(100000, 999999).ToString(), Number = rnd.Next(1000, 9999).ToString(), Address = "Алтайский район", DateOfGive = DateTime.Today, GivenBy = "Отделом УФМС" }, new Passport { PersonId = persons[2].Id, Series = rnd.Next(100000, 999999).ToString(), Number = rnd.Next(1000, 9999).ToString(), Address = "Алтайский район", DateOfGive = DateTime.Today, GivenBy = "Отделом УФМС" }, new Passport { PersonId = persons[3].Id, Series = rnd.Next(100000, 999999).ToString(), Number = rnd.Next(1000, 9999).ToString(), Address = "Алтайский район", DateOfGive = DateTime.Today, GivenBy = "Отделом УФМС" }, new Passport { PersonId = persons[4].Id, Series = rnd.Next(100000, 999999).ToString(), Number = rnd.Next(1000, 9999).ToString(), Address = "Алтайский район", DateOfGive = DateTime.Today, GivenBy = "Отделом УФМС" }, new Passport { PersonId = persons[5].Id, Series = rnd.Next(100000, 999999).ToString(), Number = rnd.Next(1000, 9999).ToString(), Address = "Алтайский район", DateOfGive = DateTime.Today, GivenBy = "Отделом УФМС" } }; foreach (var passport in passports) { passportService.CreatePassport(passport); } #endregion #region Insurance var insurances = new InsurancePolicy[] { new InsurancePolicy { PersonId = persons[0].Id, Number = rnd.Next(10000000, 99999999).ToString(), Company = "Ак Барс" }, new InsurancePolicy { PersonId = persons[1].Id, Number = rnd.Next(10000000, 99999999).ToString(), Company = "Мед. страх" }, new InsurancePolicy { PersonId = persons[2].Id, Number = rnd.Next(10000000, 99999999).ToString(), Company = "Мед. страх" }, new InsurancePolicy { PersonId = persons[3].Id, Number = rnd.Next(10000000, 99999999).ToString(), Company = "Ак Барс" }, new InsurancePolicy { PersonId = persons[4].Id, Number = rnd.Next(10000000, 99999999).ToString(), Company = "Ак Барс" }, new InsurancePolicy { PersonId = persons[5].Id, Number = rnd.Next(10000000, 99999999).ToString(), Company = "Ак Барс" } }; foreach (var insurance in insurances) { insuranceService.CreatePolicy(insurance); } #endregion } }
public InsuranceController(IInsuranceService insuranceService, IInsuranceAddingSender insuranceAddingSender) { _insuranceService = insuranceService; _insuranceAddingSender = insuranceAddingSender; Generate(); }
public InsuranceController(IInsuranceService insuranceService, IAttachmentService attachmentService, IInsuranceServiceService insuranceServiceService) { _insuranceService = insuranceService; _attachmentService = attachmentService; _insuranceServiceService = insuranceServiceService; }
public InsuranceController(IInsuranceService insuranceService) { _insuranceService = insuranceService ?? throw new InsuranceApplicationArgumentNullException(nameof(insuranceService)); }
public InsuranceMap(IInsuranceService service) { insuranceService = service; }
public InsuranceController(IInsuranceService insuranceService, IMapper mapper) { _insuranceService = insuranceService; _mapper = mapper; }
public void Setup() { _mockContentLimitCategoryDao = new Mock <IContentLimitCategoryDao>(); _mockContentLimitItemsDao = new Mock <IContentLimitItemDao>(); _sut = new InsuranceService(_mockContentLimitCategoryDao.Object, _mockContentLimitItemsDao.Object); }
public CustomerController(ICustomerService customerService, IInsuranceService insuranceService) { _customerService = customerService; _insuranceService = insuranceService; }
public InsuranceController(IInsuranceService insuranceService) { this.insuranceService = insuranceService; }
public DefaultInsuranceServiceTests() { repoMock = new Mock <IInsuranceDataRepository>(MockBehavior.Strict); service = new DefaultInsuranceService(repoMock.Object); }