Esempio n. 1
0
        public void RegisterResponseToXmlTest()
        {
            //Arrange
            RegisterResponse rr = new RegisterResponse(0, new TimeSpan(1,1,1));

            //Act
            byte[] data = rr.GetXmlData();

            //Assert
            Assert.IsNotNull(data);

            Debug.WriteLine(System.Text.Encoding.UTF8.GetString(data));
        }
Esempio n. 2
0
        public void RegisterResponseParseTest()
        {
            //Arrange
            RegisterResponse registerResponse = new RegisterResponse(120, new TimeSpan(12,12,12));
            byte[] data = registerResponse.GetXmlData();

            //Act
            XMLParser parser = new XMLParser(data);

            //Assert
            Assert.IsNotNull(parser);
            Assert.AreEqual(MessageTypes.RegisterResponse, parser.MessageType);
            RegisterResponse result = (RegisterResponse)parser.Message;
            Assert.AreEqual(registerResponse.Id, result.Id);
            Assert.AreEqual(registerResponse.Timeout.Hour, result.Timeout.Hour);
            Assert.AreEqual(registerResponse.Timeout.Minute, result.Timeout.Minute);
            Assert.AreEqual(registerResponse.Timeout.Second, result.Timeout.Second);
            Assert.AreEqual(registerResponse.Timeout.Millisecond, result.Timeout.Millisecond);
        }