Exemple #1
0
 public void SetUp()
 {
     settings              = new SMSSettings();
     settings.CountryCode  = "+7";
     settings.NumberLength = 10;
     formatter             = new PhoneNumberFormatter(settings);
 }
 public void SetUp()
 {
     settings = new SMSSettings();
     settings.CountryCode = "+7";
     settings.NumberLength = 10;
     formatter = new PhoneNumberFormatter(settings);
 }
 public MobileClientController(IPhoneNumberFormatter phoneNumberFormatter, PartnershipArmService partnershipArmService,
     PartnerService partnerService, NonValidatedRecordsPersistenceService recordsPersistenceService, CurrencyService currencyService,
     PartnershipService partnershipService, IUnitOfWork unitOfWork)
     : base(unitOfWork)
 {
     _phoneNumberFormatter = phoneNumberFormatter;
     _partnershipArmService = partnershipArmService;
     _partnerService = partnerService;
     _recordsPersistenceService = recordsPersistenceService;
     _currencyService = currencyService;
     _partnershipService = partnershipService;
 }
 public TenantsController(ApplicationDbContext context,
                          UserManager <IdentityUser> userManager,
                          RoleManager <IdentityRole> roleManager,
                          IConfiguration configuration,
                          IPhoneNumberFormatter phoneNumberFormatter)
 {
     _dbContext            = context;
     _userManager          = userManager;
     _roleManager          = roleManager;
     _configuration        = configuration;
     _phoneNumberFormatter = phoneNumberFormatter;
 }
Exemple #5
0
 public AuthenticationController(
     IConfiguration configuration,
     IPhoneNumberFormatter phoneNumberFormatter,
     SignInManager <IdentityUser> signInManager,
     ApplicationDbContext dbContext,
     UserManager <IdentityUser> userManager
     )
 {
     _configuration        = configuration;
     _phoneNumberFormatter = phoneNumberFormatter;
     _dbContext            = dbContext;
     _userManager          = userManager;
     _signInManager        = signInManager;
 }
Exemple #6
0
        // For phone numbers in different countries,
        // we might want to introduce different formatting
        public PhoneNumber(IPhoneNumberFormatter formatter, /**/)
        {
            _formatter = formatter;
        }

        public override string ToString() => _formatter.Format(this);
    }

    // Very small responsibility
    public interface IPhoneNumberFormatter
    {
        string Format(PhoneNumber number);
    }
}

namespace WorkshopPresentation.Ok6
{
    public class PhoneNumber
    {
        // For phone numbers in different countries,
        // we might want to introduce different formatting
        public PhoneNumber(/**/)
        {
        }
 public BipscoreSMSMessageSender(IPhoneNumberFormatter formatter)
 {
     _formatter = formatter;
 }
 public XWirelessMessageSender(IPhoneNumberFormatter formatter)
 {
     _formatter = formatter;
 }
 public BytehandSMSSender(SMSSettings smsSettings, IPhoneNumberFormatter numberFormatter)
 {
     this._smsSettings     = smsSettings;
     this._numberFormatter = numberFormatter;
 }
 public BytehandSMSSender(SMSSettings smsSettings, IPhoneNumberFormatter numberFormatter)
 {
     this._smsSettings = smsSettings;
     this._numberFormatter = numberFormatter;
 }