Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 3
0
 public RegisterService(
     IPasswordHasher passwordHasher,
     IEmployeeService employeeService,
     IPhoneNumberService phoneNumberService
     )
 {
     _passwordHasher          = passwordHasher;
     _employeeService         = employeeService;
     this._phoneNumberService = phoneNumberService;
 }
Ejemplo n.º 4
0
 public NotificationService(
     INotificationEntryRepository notificationEntryRepository,
     ISerializationService serializationService,
     IPhoneNumberService phoneNumberService,
     IOptions <SmsGatewayOptions> options,
     ILogger <NotificationService> logger)
 {
     _notificationEntryRepository = notificationEntryRepository;
     _serializationService        = serializationService;
     _phoneNumberService          = phoneNumberService;
     _options = options;
     _logger  = logger;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 13
0
 public SmsRepository(IDatabaseSettings databaseSettings, IPhoneNumberService phoneNumberService, IMapToExisting<Sms,Sms> smsMapper)
 {
     _databaseSettings = databaseSettings;
     _phoneNumberService = phoneNumberService;
     _smsMapper = smsMapper;
 }
Ejemplo n.º 14
0
 public ContactsController(IContactRepository repo, IPhoneNumberService phoneSrvc)
 {
     _repo      = repo;
     _phoneSrvc = phoneSrvc;
 }
Ejemplo n.º 15
0
 public HomeController(IContactService contactService, IPhoneNumberService phoneNumberService, IWebHostEnvironment hostEnvironment)
 {
     contactService_     = contactService;
     phoneNumberService_ = phoneNumberService;
     hostEnvironment_    = hostEnvironment;
 }
Ejemplo n.º 16
0
 public PhoneNumbersController(IPhoneNumberService phoneNumberService)
 {
     _phoneNumbersService = phoneNumberService;
 }
Ejemplo n.º 17
0
 public PhoneNumberController(IPhoneNumberService phoneNumberService)
 {
     this._phoneNumberService = phoneNumberService;
 }
 public PhoneNumberController(IPhoneNumberService phoneNumberService, ISmsService smsService, ICallService callService)
 {
     _phoneNumberService = phoneNumberService;
     _smsService = smsService;
     _callService = callService;
 }
Ejemplo n.º 19
0
 public CallRepository(IDatabaseSettings databaseSettings, IPhoneNumberService phoneNumberService, IMapToExisting<Call, Call> callMapper)
 {
     _databaseSettings = databaseSettings;
     _phoneNumberService = phoneNumberService;
     _callMapper = callMapper;
 }