Example #1
0
        public void ItDecodesGetUpdatesAnswerWithOneUpdate()
        {
            List <UpdateMessage> updates = ApiGetUpdatesDecoder.Decode(GET_UPDATES_ONE_UPDATE_RESPONSE);

            Assert.AreEqual(1, updates.Count);
            Assert.AreEqual(EXPECTED_ONE_UPDATE, updates.First());
        }
Example #2
0
        public void ItDecodesGetUpdatesAnswerWithManyUpdates()
        {
            List <UpdateMessage> updates = ApiGetUpdatesDecoder.Decode(GET_UPDATES_MANY_UPDATES_RESPONSES);

            Assert.AreEqual(2, updates.Count);
            Assert.IsTrue(EXPECTED_MANY_UPDATES.All(update => updates.Contains(update)));
        }
Example #3
0
        public void ItDecodesGetUpdatesAnswerWithNoUpdates()
        {
            List <UpdateMessage> updates = ApiGetUpdatesDecoder.Decode(GET_UPDATES_EMPTY_RESPONSE);

            Assert.IsEmpty(updates);
        }