コード例 #1
0
        public void TestSendMessage()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var phones = new[] { 442073238000, 442073238001 };

            var status = client.SendMessage(phones, "smstest", "test").ToArray();
            foreach (var one in status)
            {
                if (one.IsOk)
                {
                    var success = (MessageSendingSuccess)one;
                    var phone = success.Phone;
                    var messageId = success.MessageId;
                    var messagesCount = success.MessagesCount;
                    var cost = success.Cost;
                    var currency = success.Currency;
                }
                else
                {
                    var error = (MessageSendingError)one;
                    var phone = one.Phone;
                    var errorCode = error.Code;
                    var errorMessage = error.Message;
                }
            }

            Assert.IsNotNull(status);
        }
コード例 #2
0
        public void TestRemoveTemplateException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.RemoveTemplate("test1");
        }
コード例 #3
0
        public void TestGetIncomingMessagesException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.GetIncomingMessages("2014-10-27");
        }
コード例 #4
0
        public void TestEditTemplateException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.AddTemplate("test", "this is test");
        }
コード例 #5
0
        public void TestGetNetworkByPhoneException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.GetNetworkByPhone(442073238000);
        }
コード例 #6
0
        public void TestGetPhoneBaseItemsException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.GetPhoneBaseItems(125480, 2);
        }
コード例 #7
0
        public void TestAddToStopListException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.AddToStopList(442073238000);
        }
コード例 #8
0
        public void TestGetOriginatorsException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.GetOriginators();
        }
コード例 #9
0
        public void TestGetDailyStatsByMonthException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.GetDailyStatsByMonth(2014, 10);
        }
コード例 #10
0
        public void TestEditTemplate()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var template = client.EditTemplate("test", "this is test");

            Assert.IsNotNull(client);
        }
コード例 #11
0
        public void TestAddToStopList()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var id = client.AddToStopList(442073238000);

            Assert.IsNotNull(id);
        }
コード例 #12
0
        public void TestGetDeliveryStatusException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var messageId = new[] { "4196226820248326060001" };

            client.GetDeliveryStatus(messageId);
        }
コード例 #13
0
        public void TestRemoveTemplate()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var respomse = client.RemoveTemplate("test1");
            var result = respomse.Result;

            Assert.IsNotNull(respomse);
        }
コード例 #14
0
        public void TestGetNetworkByPhone()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var network = client.GetNetworkByPhone(442073238000);
            var title = network.Title;

            Assert.IsNotNull(network);
        }
コード例 #15
0
        public void TestGetBalabce()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var balance = client.GetBalance();
            var amount = balance.Amount;
            var currency = balance.Currency;

            Assert.IsNotNull(balance);
        }
コード例 #16
0
        public void TestCheckStopList()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var list = client.CheckStopList(442073238000);
            var id = list.Id;
            var timeAddedAt = list.TimeAddedAt;
            var description = list.Description;

            Assert.IsNotNull(list);
        }
コード例 #17
0
        public void TestGetOriginators()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);
            var originators = client.GetOriginators();
            foreach (var one in originators)
            {
                var name = one.Name;
                var state = one.State;
            }

            Assert.IsNotNull(originators);
        }
コード例 #18
0
        public void TestGetTemplates()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var templates = client.GetTemplates();
            foreach (var one in templates)
            {
                var id = one.Id;
                var title = one.Title;
                var template = one.template;
                var createdAt = one.CreatedAt;
            }

            Assert.IsNotNull(templates);
        }
コード例 #19
0
        public void TestGetDeliveryStatus()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);
            var messageId = new[] { "4196226820248326060001" };

            var status = client.GetDeliveryStatus(messageId);
            foreach (var one in status)
            {
                var meassageId = one.MessageId;
                var messageStatue = one.MessageStatus;
                var createdAt = one.CreatedAt;
            }

            Assert.IsNotNull(status);
        }
コード例 #20
0
        public void TestGetIncomingMessagesForPeriod()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var messages = client.GetIncomingMessages("2014-10-27", "2014-10-30");
            foreach (var one in messages)
            {
                var messageId = one.MessageId;
                var originator = one.Originator;
                var prefix = one.Prefix;
                var receivedAt = one.ReceivedAt;
                var text = one.Text;
                var destination = one.Destination;
            }

            Assert.IsNotNull(messages);
        }
コード例 #21
0
        public void TestGetPhoneBases()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var balance = client.GetPhoneBases();
            foreach (var one in balance)
            {
                var baseId = one.BaseId;
                var title = one.Title;
                var count = one.Count;
                var pages = one.Pages;
                var birthday = one.BirthdayGreetingSettings;
                var enabled = birthday.Enabled;
                var originator = birthday.Originator;
                var daysBefore = birthday.DaysBefore;
                var timeToSend = birthday.TimeToSend;
                var useLocalTime = birthday.UseLocalTime;
                var template = birthday.Template;
            }
        }
コード例 #22
0
        public void TestGetHlrStats()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var hlrStatItem = client.GetHlrStats("2014-07-01", "2014-10-01");
            foreach (var one in hlrStatItem)
            {
                var messageId = one.MessageId;
                var requestId = one.RequestId;
                var requestTime = one.RequestTime;
                var totalPrice = one.TotalPrice;
                var id = one.Id;
                var imsi = one.Imsi;
                var destination = one.Destination;
                var mcc = one.Mcc;
                var mnc = one.Mnc;
                var originalCountryCode = one.OriginalCountryCode;
                var originalCountryName = one.OriginalCountryName;
                var originalNetworkName = one.OriginalNetworkName;
                var originalNetworkPrefix = one.OriginalNetworkPrefix;
                var portedCountryName = one.PortedCountryName;
                var portedCountryPrefix = one.PortedCountryPrefix;
                var portedNetworkName = one.PortedNetworkName;
                var portedNetworkPrefix = one.PortedNetworkPrefix;
                var pricePerMessage = one.PricePerMessage;
                var roamingCountryName = one.RoamingCountryName;
                var roamingCountryPrefix = one.RoamingCountryPrefix;
                var roamingNetworkName = one.RoamingNetworkName;
                var roamingNetworkPrefix = one.RoamingNetworkPrefix;
                var status = one.Status;
                var isPorted = one.IsPorted;
                var isInRoaming = one.IsInRoaming;
            }

            Assert.IsNotNull(hlrStatItem);
        }
コード例 #23
0
        public void TestGetPhoneBaseItems()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var bases = client.GetPhoneBaseItems(125480, 2);
            foreach (var one in bases)
            {
                var phone = one.Phone;
                var firstName = one.FirstName;
                var middleName = one.MiddleName;
                var lastName = one.LastName;
                var birthDay = one.BirthDay;
                var area = one.Area;
                var gender = one.Gender;
                var network = one.Network;
                var note1 = one.Note1;
                var note2 = one.Note2;
            }

            Assert.IsNotNull(bases);
        }
コード例 #24
0
        public void TestGetDailyStatsByMonth()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var stats = client.GetDailyStatsByMonth(2014, 10);

            foreach (var one in stats)
            {
                var day = one.Day;
                var s = one.Stats;
                foreach (var i in s)
                {
                    var cost = i.Cost;
                    var count = i.Count;
                    var currency = i.Currency;
                    var state = i.State;
                }
            }

            Assert.IsNotNull(stats);
        }
コード例 #25
0
        public void TestMakeHlrRequest()
        {
            IApiConnector connector = new LocalApiConnector(getData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var phones = new[] { 442073238000, 442073238001 };
            var hlrResponse = client.MakeHlrRequest(phones);

            foreach (var one in hlrResponse)
            {
                var id = one.Id;
                var imsi = one.Imsi;
                var destination = one.Destination;
                var mcc = one.Mcc;
                var mnc = one.Mnc;
                var originalCountryCode = one.OriginalCountryCode;
                var originalCountryName = one.OriginalCountryName;
                var originalNetworkName = one.OriginalNetworkName;
                var originalNetworkPrefix = one.OriginalNetworkPrefix;
                var portedCountryName = one.PortedCountryName;
                var portedCountryPrefix = one.PortedCountryPrefix;
                var portedNetworkName = one.PortedNetworkName;
                var portedNetworkPrefix = one.PortedNetworkPrefix;
                var pricePerMessage = one.PricePerMessage;
                var roamingCountryName = one.RoamingCountryName;
                var roamingCountryPrefix = one.RoamingCountryPrefix;
                var roamingNetworkName = one.RoamingNetworkName;
                var roamingNetworkPrefix = one.RoamingNetworkPrefix;
                var status = one.Status;
                var isPorted = one.IsPorted;
                var isInRoaming = one.IsInRoaming;
            }

            Assert.IsNotNull(hlrResponse);
        }
コード例 #26
0
        public void TestGetHlrStatsException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            client.GetHlrStats("2014-07-01", "2014-10-01");
        }
コード例 #27
0
        public void TestSendMessageException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var phones = new[] { 442073238000, 442073238001 };

            client.SendMessage(phones, "smstest", "test");
        }
コード例 #28
0
        public void TestMakeHlrRequestException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

            var client = new IntisClient(Login, ApiKey, ApiHost, connector);

            var phones = new[] { 442073238000, 442073238001 };
            client.MakeHlrRequest(phones);
        }