コード例 #1
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);
        }
コード例 #2
0
 public void ShouldReturnTheBalanceBasedOnXml()
 {
     deserializer = new SoSMSResponseDeserializer(typeof(SoSMSBalance), XmlMockedResponses.AccountBalance());
     SoSMSBalance balance = (SoSMSBalance) deserializer.Deserialize();
     Assert.AreEqual(106, balance.Value);
 }