using Knoks.Framework.Services;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Xunit;

namespace Knoks.Test.Integrations.Framework
{
    public class PlivoSmsServiceTests
    {
        static PlivoSmsService _plivoService = new PlivoSmsService(new Logger<PlivoSmsService>(new LoggerFactory()), 
            new PlivoSmsSettings
            {
                AuthId = "MAZDHLMGRINJY3M2MWZT",
                AuthToken = "NzFiYjJiNjVlZjc1MGIzN2M5ODdjYzBjZTg3YTZl",
                BaseAddress = "https://api.plivo.com/v1/Account"
            });

        [Theory(DisplayName = "Sms Message - Ok", Skip = "Paid service!")]
        //[Theory(DisplayName = "Sms Message - Ok")]
        [InlineData("+972(54)242-8384", "+972(54)4671976")]
        public async Task SendMessage(string srcNumber, params string[] destNumbers)
        {
            var result = await _plivoService.SendMessage("Knoks Test:\n" + DateTime.UtcNow.ToString(), srcNumber, destNumbers);
            Assert.True(result);
        }
    }
}
