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);
        }
        public void TestRemoveTemplateException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.RemoveTemplate("test1");
        }
        public void TestGetIncomingMessagesException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.GetIncomingMessages("2014-10-27");
        }
        public void TestEditTemplateException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.AddTemplate("test", "this is test");
        }
        public void TestGetNetworkByPhoneException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.GetNetworkByPhone(442073238000);
        }
        public void TestGetPhoneBaseItemsException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.GetPhoneBaseItems(125480, 2);
        }
        public void TestAddToStopListException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.AddToStopList(442073238000);
        }
        public void TestGetOriginatorsException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.GetOriginators();
        }
        public void TestGetDailyStatsByMonthException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.GetDailyStatsByMonth(2014, 10);
        }
        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);
        }
        public void TestAddToStopList()
        {
            IApiConnector connector = new LocalApiConnector(getData());

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

            var id = client.AddToStopList(442073238000);

            Assert.IsNotNull(id);
        }
        public void TestGetDeliveryStatusException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

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

            client.GetDeliveryStatus(messageId);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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;
            }
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        public void TestGetHlrStatsException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

            client.GetHlrStats("2014-07-01", "2014-10-01");
        }
        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");
        }
        public void TestMakeHlrRequestException()
        {
            IApiConnector connector = new LocalApiConnector(getErrorData());

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

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