예제 #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());
        }
예제 #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)));
        }
예제 #3
0
        public void ItDecodesGetUpdatesAnswerWithNoUpdates()
        {
            List <UpdateMessage> updates = ApiGetUpdatesDecoder.Decode(GET_UPDATES_EMPTY_RESPONSE);

            Assert.IsEmpty(updates);
        }