Exemple #1
0
        public void TestBalance()
        {
            var sms = new SMSCentre.SMSC(_login, _password);
            var res = sms.GetBalance();

            Assert.NotEmpty(res);
            Assert.True(decimal.Parse(res) > 0);
        }
Exemple #2
0
        public void TestSmsStatusInCorrectId()
        {
            var sms = new SMSCentre.SMSC(_login, _password);
            var res = sms.GetStatus("11111111111", _phone);

            Assert.True(res is ISmsResult);
            Assert.True(res is SmsErrorResult);
            var smsRes = res as SmsErrorResult;

            Assert.Equal(-3, smsRes.Status);
            Assert.Equal("11111111111", smsRes.Id);
        }
Exemple #3
0
        public void TestSendSmsInValidNumber()
        {
            var sms = new SMSCentre.SMSC(_login, _password);
            var res = sms.SendSms("111", "Test");

            Assert.True(res is ISmsResult);
            Assert.True(res is SmsErrorResult);
            var smsRes = res as SmsErrorResult;

            Assert.Equal(-7, smsRes.Status);
            Assert.NotEmpty(smsRes.Id);
        }
Exemple #4
0
        public void TestSmsStatus()
        {
            var sms = new SMSCentre.SMSC(_login, _password);
            var res = sms.GetStatus("1", _phone);

            Assert.True(res is ISmsResult);
            Assert.True(res is SmsStatusResult);
            var smsRes = res as SmsStatusResult;

            Assert.Equal(1, smsRes.Status);
            Assert.Equal("Доставлено", smsRes.StatusDescription);
            Assert.Equal("Filuet", smsRes.Sender);
            Assert.Equal("Test", smsRes.Text);
        }
Exemple #5
0
        public void TestSendSmsValidNumber()
        {
            var message = "Test";
            var sms     = new SMSCentre.SMSC(_login, _password);
            var res     = sms.SendSms(_phone, message);

            Assert.True(res is ISmsResult);
            Assert.True(res is SmsResult);
            var smsRes = res as SmsResult;

            Assert.Equal(_phone, smsRes.Phone);
            Assert.Equal(message, smsRes.Text);
            Assert.True(smsRes.Balance > 0);
            Assert.True(smsRes.Cost > 0);
        }