private void Setup() { _withoutNamespaceDeclarationsXml = new XmlSanitizer().Sanitize(TestConstants.RawGarminXmlWith5TrackPoints); var xDoc = XDocument.Parse(_withoutNamespaceDeclarationsXml); xDoc.Descendants(ActivityBuilder.LapName).Remove(); _emptyActivityXml = xDoc.ToString(SaveOptions.None); xDoc.Descendants(ActivityBuilder.ActivityName).Remove(); _emptyXml = xDoc.ToString(SaveOptions.None); _activityBuilder = new ActivityBuilder(_withoutNamespaceDeclarationsXml); _activityBuilder.Build(); }
public void AssertCanBuildEmptyActivity() { var e = new ActivityBuilder(_emptyActivityXml); e.Build(); Assert.NotNull(e.Activity); Assert.AreEqual(0, e.Laps.Count); }