public void ShouldReturnTheBalanceBasedOnXml() { deserializer = new SoSMSResponseDeserializer(typeof(SoSMSBalance), XmlMockedResponses.AccountBalance()); SoSMSBalance balance = (SoSMSBalance)deserializer.Deserialize(); Assert.AreEqual(106, balance.Value); }
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); }
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); }
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); }
public void ShouldGetAccountBalance() { MockHttpResponse(XmlMockedResponses.AccountBalance(), HttpStatusCode.OK); Assert.AreEqual(106, client.GetBalance().Value); }