public void metadata_document_generated_correctly_for_record_without_resources()
        {
            var record         = GetRecordFromFile(new Guid("c6f3632d-8789-460b-a09d-c132841a7190"), @"records.c6f3632d-8789-460b-a09d-c132841a7190.json");
            var expectedXmlDoc = GetInputFileAsXmlDoc(@"wafs.c6f3632d-8789-460b-a09d-c132841a7190.xml");

            var xmlHelper    = new OpenDataXmlHelper();
            var actualWaf    = xmlHelper.GetMetadataDocument(record, "");
            var actualXmlDoc = GetByteArrayAsXmlDoc(actualWaf);

            XmlDiff xmlDiff = new XmlDiff();

            Assert.True(xmlDiff.Compare(expectedXmlDoc, actualXmlDoc));
        }
        public void metadata_document_generated_correctly_for_record_with_additional_resource()
        {
            var record         = GetRecordFromFile(new Guid("4cb2cca3-ec95-4962-9618-8556d88390fd"), @"records.4cb2cca3-ec95-4962-9618-8556d88390fd.json");
            var expectedXmlDoc = GetInputFileAsXmlDoc(@"wafs.4cb2cca3-ec95-4962-9618-8556d88390fd.xml");

            var xmlHelper    = new OpenDataXmlHelper();
            var actualWaf    = xmlHelper.GetMetadataDocument(record, "");
            var actualXmlDoc = GetByteArrayAsXmlDoc(actualWaf);

            XmlDiff xmlDiff = new XmlDiff();

            Assert.True(xmlDiff.Compare(expectedXmlDoc, actualXmlDoc));
        }
        public void metadata_document_generated_correctly_for_record_with_resources()
        {
            var record         = GetRecordFromFile(new Guid("721643b8-7e42-40ca-87d9-23f19221238e"), @"records.721643b8-7e42-40ca-87d9-23f19221238e.json");
            var expectedXmlDoc = GetInputFileAsXmlDoc(@"wafs.721643b8-7e42-40ca-87d9-23f19221238e.xml");

            var xmlHelper    = new OpenDataXmlHelper();
            var actualWaf    = xmlHelper.GetMetadataDocument(record, "http://data.jncc.gov.uk/data/721643b8-7e42-40ca-87d9-23f19221238e-Scotia-Herring-Acoustic-Grab.zip");
            var actualXmlDoc = GetByteArrayAsXmlDoc(actualWaf);

            XmlDiff xmlDiff = new XmlDiff();

            Assert.True(xmlDiff.Compare(expectedXmlDoc, actualXmlDoc));
        }
        public void waf_index_document_generated_correctly()
        {
            var record           = GetRecordFromFile(new Guid("721643b8-7e42-40ca-87d9-23f19221238e"), @"records.721643b8-7e42-40ca-87d9-23f19221238e.json");
            var initialIndex     = GetInputFileContents(@"wafs.index_initial.html");
            var expectedIndexDoc = GetInputFileAsXmlDoc(@"wafs.index_expected.html");

            var xmlHelper      = new OpenDataXmlHelper();
            var actualWaf      = xmlHelper.UpdateWafIndexDocument(record, initialIndex);
            var actualIndexDoc = GetStringAsXmlDoc(actualWaf);

            XmlDiff xmlDiff = new XmlDiff();

            Assert.True(xmlDiff.Compare(expectedIndexDoc, actualIndexDoc));
        }