Esempio n. 1
0
        public void Read_form_information()
        {
            ReceivedMessage <FormResult> receivedMessage = (ReceivedMessage <FormResult>)ReceivedMessage.Parse(Utils.ReadFile(JsonsDirectory + "form\\FormRecevied.json"));
            int valuesCount = 5;

            FormResult expectedForm = new FormResult()
            {
                CallbackId = "N7YcI5rAlX2sEFmh",
                MessageId  = 97,
                Data       = "name=Ehsan&married=y&city=mashhad&address=Iran&agree=true"
            };

            receivedMessage.Data.ParseData().Should().BeEquivalentTo(expectedForm.ParseData());
            receivedMessage.Data.ParsedData.Count.Should().Be(valuesCount);
            Assert.Contains(new KeyValuePair <string, string>("name", "Ehsan"), receivedMessage.Data.ParseData());
        }