public ToWhatsAppActivityConverterTest() { var infobipClient = new Mock <IInfobipWhatsAppClient>(MockBehavior.Strict); infobipClient.Setup(x => x.GetContentTypeAsync(It.IsAny <string>(), It.IsAny <CancellationToken>())).ReturnsAsync(_contentType); _adapterOptions = TestOptions.Get(); _toActivityConverter = new ToWhatsAppActivityConverter(_adapterOptions, infobipClient.Object, NullLogger.Instance); }
/// <summary> /// Initializes a new instance of the <see cref="InfobipWhatsAppAdapter"/> class using configuration settings. /// </summary> /// <param name="infobipWhatsAppOptions">Adapter options. Typically created via appsettings loaded into an IConfiguration.</param> /// <param name="infobipWhatsAppClient">Client/Proxy used to communicate with Infobip.</param> /// <param name="logger">Logger.</param> public InfobipWhatsAppAdapter(InfobipWhatsAppAdapterOptions infobipWhatsAppOptions, IInfobipWhatsAppClient infobipWhatsAppClient, ILogger <InfobipWhatsAppAdapter> logger) { _whatsAppAdapterOptions = infobipWhatsAppOptions ?? throw new ArgumentNullException(nameof(infobipWhatsAppOptions)); _infobipWhatsAppClient = infobipWhatsAppClient ?? throw new ArgumentNullException(nameof(infobipWhatsAppClient)); _logger = logger ?? NullLogger <InfobipWhatsAppAdapter> .Instance; _toWhatsAppActivityConverter = new ToWhatsAppActivityConverter(_whatsAppAdapterOptions, _infobipWhatsAppClient, _logger); _authorizationHelper = new AuthorizationHelper(); }