Esempio n. 1
0
        public void InsertObsResp_211_Read_NoExtension()
        {
            // Testing that deserialisation works when the extension does not exist.
            // Only asserting a single field to see that deserialisation has succeeded in general.

            string filepath   = TestCommon.TestHelper.TestFileFolder + @"\InsertObservationResponse_empty.xml";
            var    testObject = new InsertObservationResponse(ReadFile(filepath));

            Assert.AreEqual(RequestResultType.Unknown, testObject.RequestResult);
        }
Esempio n. 2
0
        public void InsertObsResp_210_Read()
        {
            // This test is very simple, because ExtensibleResponse provides
            // almost all the functionality of InsertObservationResponse and
            // ExtensibleResponse is tested elsewhere.

            string filepath   = TestCommon.TestHelper.TestFileFolder + @"\InsertObservationResponse_ok.xml";
            var    testObject = new InsertObservationResponse(ReadFile(filepath));

            Assert.AreEqual(RequestResultType.Ok, testObject.RequestResult);
        }
Esempio n. 3
0
        public void InsertObsResp_220_Create()
        {
            // This test is very simple, because ExtensibleResponse provides
            // almost all the functionality of InsertObservationResponse and
            // ExtensibleResponse is tested elsewhere.

            var testObject = new InsertObservationResponse()
            {
                RequestResult = RequestResultType.NotFound
            };

            // Serialising, validating and deserialising
            var xmlBytes = testObject.ToXmlBytes();

            Validate(xmlBytes);
            var testObjectIn = new InsertObservationResponse(xmlBytes);

            Assert.AreEqual(RequestResultType.NotFound, testObjectIn.RequestResult);
        }