Exemple #1
0
        public void ShouldReturnTheBalanceBasedOnXml()
        {
            deserializer = new SoSMSResponseDeserializer(typeof(SoSMSBalance), XmlMockedResponses.AccountBalance());
            SoSMSBalance balance = (SoSMSBalance)deserializer.Deserialize();

            Assert.AreEqual(106, balance.Value);
        }
Exemple #2
0
        public void ShoudDeserializeAMessageXml()
        {
            deserializer = new SoSMSResponseDeserializer(typeof(SoSMSMessage), XmlMockedResponses.Message());
            SoSMSMessage message = (SoSMSMessage)deserializer.Deserialize();

            Assert.AreEqual(1002, message.Id);
            Assert.AreEqual("Test", message.Text);
            Assert.AreEqual(3, message.Dispaches.Length);

            Assert.AreEqual("Processando", message.Dispaches[0].Status);
            Assert.AreEqual("(00) 0000-0000", message.Dispaches[0].PhoneNumber);
        }
Exemple #3
0
        public void ShouldGetTheInfoAboutAMessage()
        {
            MockHttpResponse(XmlMockedResponses.Message(), HttpStatusCode.OK);

            SoSMSMessage message = client.GetMessage(1002);

            Assert.AreEqual("Test", message.Text);

            SoSMSMessageDispach dispach = message.Dispaches[0];

            Assert.AreEqual("Processando", dispach.Status);
            Assert.AreEqual("(00) 0000-0000", dispach.PhoneNumber);
        }
Exemple #4
0
        public void ShouldSendAMessageToContacts()
        {
            MockHttpResponse(XmlMockedResponses.Message(), HttpStatusCode.OK);

            SoSMSMessage message = client.SendMessage("Test", "Joao:0000000000,Luisa:9999999999,Mario:8888888888");

            Assert.IsNotNull(message.Id);
            Assert.AreEqual("Test", message.Text);

            SoSMSMessageDispach dispach = message.Dispaches[0];

            Assert.AreEqual("Processando", dispach.Status);
            Assert.AreEqual("(00) 0000-0000", dispach.PhoneNumber);

            dispach = message.Dispaches[1];
            Assert.AreEqual("Processando", dispach.Status);
            Assert.AreEqual("(99) 9999-9999", dispach.PhoneNumber);

            dispach = message.Dispaches[2];
            Assert.AreEqual("Processando", dispach.Status);
            Assert.AreEqual("(88) 8888-8888", dispach.PhoneNumber);
        }
Exemple #5
0
 public void ShouldGetAccountBalance()
 {
     MockHttpResponse(XmlMockedResponses.AccountBalance(), HttpStatusCode.OK);
     Assert.AreEqual(106, client.GetBalance().Value);
 }