Example #1
0
        public void SuccessTest()
        {
            string xml = @"<?xml version=""1.0"" encoding=""utf-8""?>
<response>
      <control>
            <status>success</status>
            <senderid>testsenderid</senderid>
            <controlid>ControlIdHere</controlid>
            <uniqueid>false</uniqueid>
            <dtdversion>3.0</dtdversion>
      </control>
</response>";

            Stream       stream       = new MemoryStream();
            StreamWriter streamWriter = new StreamWriter(stream);

            streamWriter.Write(xml);
            streamWriter.Flush();

            stream.Position = 0;

            MockAbstractResponse response = new MockAbstractResponse(stream);
            Control control = response.Control;

            Assert.Equal("testsenderid", control.SenderId);
            Assert.Equal("ControlIdHere", control.ControlId);
            Assert.Equal("false", control.UniqueId);
            Assert.Equal("3.0", control.DtdVersion);
        }
Example #2
0
        public void MissingStatusElementTest()
        {
            string xml = @"<?xml version=""1.0"" encoding=""utf-8""?>
<response>
      <control />
</response>";

            Stream       stream       = new MemoryStream();
            StreamWriter streamWriter = new StreamWriter(stream);

            streamWriter.Write(xml);
            streamWriter.Flush();

            stream.Position = 0;

            MockAbstractResponse response = new MockAbstractResponse(stream);
        }
Example #3
0
        public void MissingSenderIdElementTest()
        {
            string xml = @"<?xml version=""1.0"" encoding=""utf-8""?>
<response>
      <control>
            <status>success</status>
            <!--<senderid>testsenderid</senderid>-->
            <controlid>ControlIdHere</controlid>
            <uniqueid>false</uniqueid>
            <dtdversion>3.0</dtdversion>
      </control>
</response>";

            Stream       stream       = new MemoryStream();
            StreamWriter streamWriter = new StreamWriter(stream);

            streamWriter.Write(xml);
            streamWriter.Flush();

            stream.Position = 0;

            MockAbstractResponse response = new MockAbstractResponse(stream);
        }