/// <summary> /// Creates a new PhoneNumberHandler /// </summary> /// <param name="phoneNumberService">The phone number service.</param> /// <param name="userProvider">The user provider to get current user information.</param> public PhoneNumberHandler(IPhoneNumberService phoneNumberService, IUserProvider userProvider) { Contract.Requires(phoneNumberService != null, "The email address service must not be null."); Contract.Requires(userProvider != null, "The user provider must not be null."); this.phoneNumberService = phoneNumberService; this.userProvider = userProvider; }
/// <summary> /// Creates a new instance of the controller. /// </summary> /// <param name="userProvider">The user provider.</param> /// <param name="phoneNumberTypeService">The social media type service.</param> /// <param name="phoneNumberService">The social media service.</param> public PhoneNumbersController(IUserProvider userProvider, IPhoneNumberTypeService phoneNumberTypeService, IPhoneNumberService phoneNumberService) { Contract.Requires(phoneNumberTypeService != null, "The phone number type service must not be null."); Contract.Requires(phoneNumberService != null, "The phone number service must not be null."); Contract.Requires(userProvider != null, "The user provider must not be null."); this.phoneNumberTypeService = phoneNumberTypeService; this.phoneNumberService = phoneNumberService; this.userProvider = userProvider; }
public RegisterService( IPasswordHasher passwordHasher, IEmployeeService employeeService, IPhoneNumberService phoneNumberService ) { _passwordHasher = passwordHasher; _employeeService = employeeService; this._phoneNumberService = phoneNumberService; }
public NotificationService( INotificationEntryRepository notificationEntryRepository, ISerializationService serializationService, IPhoneNumberService phoneNumberService, IOptions <SmsGatewayOptions> options, ILogger <NotificationService> logger) { _notificationEntryRepository = notificationEntryRepository; _serializationService = serializationService; _phoneNumberService = phoneNumberService; _options = options; _logger = logger; }
public ClientService(IClientRepository clientRepository, IUserService userService, ILocationService locationService, IPhoneNumberService phoneNumberService, IEmployeeRepository employeeRepository, IEmployeeService employeeService, ICompanyService companyService) : base(clientRepository) { _clientRepository = clientRepository; _userService = userService; _locationService = locationService; _phoneNumberService = phoneNumberService; _employeeRepository = employeeRepository; _employeeService = employeeService; _companyService = companyService; }
public CompanyService(ICompanyRepository companyRepository, IUserRepository userRepository, IEmployeeRepository employeeRepository, IServiceRepository serviceRepository, IPolicyRepository policyRepository, IUserService userService, ILocationService locationService, IPhoneNumberService phoneNumberService) : base(companyRepository) { _companyRepository = companyRepository; _userRepository = userRepository; _employeeRepository = employeeRepository; _serviceRepository = serviceRepository; _policyRepository = policyRepository; _userService = userService; _locationService = locationService; _phoneNumberService = phoneNumberService; }
public void FindPhoneNumberById_Service_Success() { // Arrange phoneNumberService = new PhoneNumberService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object); mockRepository.Setup(x => x.FindById <PhoneNumber>(It.IsAny <int>())).Returns(new PhoneNumber()).Verifiable(); // Act var response = phoneNumberService.FindPhoneNumberById(It.IsAny <int>()); // Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Result); Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <PhoneNumberDto>)); mockRepository.Verify(x => x.FindById <PhoneNumber>(It.IsAny <int>()), Times.Once); }
public EmployeeService(IEmployeeRepository employeeRepository, IServiceEmployeeRepository serviceEmployeeRepository, IEmployeeWorkHoursService employeeWorkHoursService, IServiceRepository serviceRepository, IUserService userService, ICompanyRepository companyRepository, ILocationService locationService, IPhoneNumberService phoneNumberService) : base(employeeRepository) { _employeeRepository = employeeRepository; _serviceEmployeeRepository = serviceEmployeeRepository; _employeeWorkHoursService = employeeWorkHoursService; _serviceRepository = serviceRepository; _userService = userService; _companyRepository = companyRepository; _locationService = locationService; _phoneNumberService = phoneNumberService; }
public void DeletePhoneNumberById_Service_Fail() { // Arrange phoneNumberService = new PhoneNumberService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object); mockRepository.Setup(x => x.Delete <PhoneNumber>(It.IsAny <int>())).Returns(false).Verifiable(); // Act var response = phoneNumberService.DeletePhoneNumber(It.IsAny <int>()); // Assert Assert.IsNotNull(response); Assert.IsFalse(response.Result); Assert.IsTrue(response.Notifications.HasErrors()); Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <bool>)); mockRepository.Verify(x => x.Delete <PhoneNumber>(It.IsAny <int>()), Times.Once); }
public void GetAllPhoneNumbers_Service_Fail() { // Arrange phoneNumberService = new PhoneNumberService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object); mockRepository.Setup(x => x.All <PhoneNumber>()).Throws(new Exception()).Verifiable(); // Act var response = phoneNumberService.GetAllPhoneNumbers(); // Assert Assert.IsNotNull(response); Assert.IsNull(response.Result); Assert.IsTrue(response.Notifications.HasErrors()); Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <IEnumerable <PhoneNumberDto> >)); mockRepository.Verify(x => x.All <PhoneNumber>(), Times.Once); }
public void UpdatePhoneNumber_Service_Success() { // Arrange phoneNumberService = new PhoneNumberService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object); mockRepository.Setup(x => x.Update(It.IsAny <PhoneNumber>())).Returns(true).Verifiable(); // Act var phoneNumber = new PhoneNumberDto(); var response = phoneNumberService.UpdatePhoneNumber(phoneNumber); // Assert Assert.IsNotNull(response); Assert.IsTrue(response.Result); Assert.IsFalse(response.Notifications.HasErrors()); Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <bool>)); mockRepository.Verify(x => x.Update(It.IsAny <PhoneNumber>()), Times.Once); }
public UserService( IEmailService email, IUserRepository userRepository, IClientRepository clientRepository, SigningConfiguration signingConfiguration, TokenConfiguration tokenConfiguration, ILocationService locationService, IConfiguration configuration, IPhoneNumberService phoneNumberService, IEmployeeRepository employeeRepository, ICompanyRepository companyRepository) : base(userRepository) { _email = email; _userRepository = userRepository; _clientRepository = clientRepository; _signingConfiguration = signingConfiguration; _tokenConfiguration = tokenConfiguration; _configuration = configuration; _locationService = locationService; _phoneNumberService = phoneNumberService; _employeeRepository = employeeRepository; _companyRepository = companyRepository; }
public SmsRepository(IDatabaseSettings databaseSettings, IPhoneNumberService phoneNumberService, IMapToExisting<Sms,Sms> smsMapper) { _databaseSettings = databaseSettings; _phoneNumberService = phoneNumberService; _smsMapper = smsMapper; }
public ContactsController(IContactRepository repo, IPhoneNumberService phoneSrvc) { _repo = repo; _phoneSrvc = phoneSrvc; }
public HomeController(IContactService contactService, IPhoneNumberService phoneNumberService, IWebHostEnvironment hostEnvironment) { contactService_ = contactService; phoneNumberService_ = phoneNumberService; hostEnvironment_ = hostEnvironment; }
public PhoneNumbersController(IPhoneNumberService phoneNumberService) { _phoneNumbersService = phoneNumberService; }
public PhoneNumberController(IPhoneNumberService phoneNumberService) { this._phoneNumberService = phoneNumberService; }
public PhoneNumberController(IPhoneNumberService phoneNumberService, ISmsService smsService, ICallService callService) { _phoneNumberService = phoneNumberService; _smsService = smsService; _callService = callService; }
public CallRepository(IDatabaseSettings databaseSettings, IPhoneNumberService phoneNumberService, IMapToExisting<Call, Call> callMapper) { _databaseSettings = databaseSettings; _phoneNumberService = phoneNumberService; _callMapper = callMapper; }