Example #1
0
 public void AssertWhenXmlIsEmptyContatinsNoActivity()
 {
     var e = new ActivityBuilder(_emptyXml);
     Assert.IsFalse(e.ContainsActivity);
 }
Example #2
0
        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();
        }
Example #3
0
        public void AssertCanBuildEmptyActivity()
        {
            var e = new ActivityBuilder(_emptyActivityXml);
            e.Build();

            Assert.NotNull(e.Activity);
            Assert.AreEqual(0, e.Laps.Count);
        }