public void GetAll_Successful_8_AggregatesReturned()
        {
            //  Arrange
            var styleKml = XElement.Parse(_styles);
            var styles = styleKml.Descendants(_kmlns + "Style");
            var styleDictionary = styles.ToDictionary(style => style.Attribute("id").Value);

            var areaKml = XElement.Parse(_areaPlacemarks);
            var areaPlacemarks = areaKml.Descendants(_kmlns + "Placemark");
            var refAreaPlacemarks = areaPlacemarks.ToArray();
            //XElement nullAreaPlacemark = null;

            //  Set up the method responses from the Mock helper class
            _mockSnhHelper.Setup(h => h.NameFolderExists(It.IsAny<XElement>()))
                .Returns(false);
            _mockSnhHelper.Setup(s => s.GetStyles(It.IsAny<XElement>()))
                .Returns(styleDictionary);
            _mockSnhHelper.Setup(p => p.GetAreaPlacemarks(It.IsAny<XElement>()))
                .Returns(areaPlacemarks);
            _mockSnhHelper.Setup(n => n.GetPlacemarkName(It.IsAny<XElement>()))
                .Returns((XElement x) => x.Element(_kmlns + "name").Value);
            for (int i = 0; i < refAreaPlacemarks.Count(); i++)
            {
                _mockSnhHelper.Setup(f => f.CombineFootprintData(It.IsAny<XElement>(), refAreaPlacemarks[i]))
                    .Returns(refAreaPlacemarks[i]);        // Should return the value passed in.
            }
            _mockSnhHelper.Setup(s => s.SanitisePlacemarkCoordinates(It.IsAny<XElement>()))
                .Returns((XElement x) => x);        //  Just return the XElement passed in.
            _mockSnhHelper.Setup(s => s.GetPlacemarkStatus(It.IsAny<XElement>()))
                .Returns((XElement x) => x.Element(_kmlns + "styleUrl").Value.Trim('#'));

            //  Instantiate the SnhDataSource class
            _datasource = new SnhDataSource(_mockSnhHelper.Object);
            _datasource.SetSource(areaKml, _kmlns);     // Set the Kmlns and data in the data source model.

            //  Act
            var results = _datasource.GetAll().ToArray();

            //  Assert
            Assert.AreEqual(8, results.Count(), "Expected 8 results to be returned");
            Assert.AreEqual("A'Chruach", results[1].Identifier, "Expected the 2nd aggregate to be 'A'Cruach'");
            Assert.AreEqual("A'Chruach Extension", results[2].Identifier, "Expected the 3rd aggregate to be 'A'Cruach Extension'");
            Assert.AreEqual("Aikengall", results[6].Identifier, "Expected the 7th aggregate to be 'Aikengall'");
        }
        public void GetAll_NoAreaPlacemarks_Unsuccessful_0_AggregatesReturned()
        {
            //  Arrange
            var styleKml = XElement.Parse(_styles);
            var styles = styleKml.Descendants(_kmlns + "Style");
            var styleDictionary = styles.ToDictionary(style => style.Attribute("id").Value);

            var areaKml = XElement.Parse(_areaPlacemarks);
            var areaPlacemarks = areaKml.Descendants(_kmlns + "Placemark");
            //var refAreaPlacemarks = areaPlacemarks.ToArray();
            //XElement nullAreaPlacemark = null;

            //  Set up the method responses from the Mock helper class
            _mockSnhHelper.Setup(h => h.NameFolderExists(It.IsAny<XElement>()))
                .Returns(false);
            _mockSnhHelper.Setup(s => s.GetStyles(It.IsAny<XElement>()))
                .Returns(styleDictionary);
            _mockSnhHelper.Setup(p => p.GetAreaPlacemarks(It.IsAny<XElement>()))
                .Returns(new Collection<XElement>());               // No area placemarks found in file (unlike situation)
            _mockSnhHelper.Setup(n => n.GetPlacemarkName(It.IsAny<XElement>()))
                .Returns(string.Empty);
            //for (int i = 0; i < refAreaPlacemarks.Count(); i++)
            //{
            //    _mockSnhHelper.Setup(f => f.CombineFootprintData(It.IsAny<XElement>(), refAreaPlacemarks[i]))
            //        .Returns(refAreaPlacemarks[i]);        // Should return the value passed in.
            //}
            _mockSnhHelper.Setup(s => s.GetPlacemarkStatus(It.IsAny<XElement>()))
                .Returns(string.Empty);

            //  Instantiate the SnhDataSource class
            _datasource = new SnhDataSource(_mockSnhHelper.Object);
            _datasource.SetSource(areaKml, _kmlns);     // Set the Kmlns and data in the data source model.

            //  Act
            var results = _datasource.GetAll().ToArray();

            //  Assert
            Assert.AreEqual(0, results.Count(), "Expected zero results to be returned");
            //Assert.AreEqual("A'Chruach", results[1].Identifier, "Expected the 2nd aggregate to be 'A'Cruach'");
            //Assert.AreEqual("A'Chruach Extension", results[2].Identifier, "Expected the 3rd aggregate to be 'A'Cruach Extension'");
            //Assert.AreEqual("Aikengall", results[6].Identifier, "Expected the 7th aggregate to be 'Aikengall'");
        }