public void CanGetCurlString() { var tideinfo = new TideInformation() { Type = "Low", HeightMeters = 1.2, TideOccurence = new DateTime(2015,09,05,1,45,00), TideNumberThisDay = 1 }; var notificationFactory = new PebbleTimeTideNotificationFactory("testKey"); var opstring = notificationFactory.GetTideNotification(tideinfo); Assert.That(opstring, Is.Not.Null); }
private static List<string> ReadNotifications(string path) { var tideParser = new TideParser(); var notificationFactory = new PebbleTimeTideNotificationFactory(apiKey); var tideNotifications = new List<string>(); using (var parser = new TextFieldParser(path)) { parser.TextFieldType = FieldType.Delimited; parser.SetDelimiters(","); while (!parser.EndOfData) { //Processing row var fields = parser.ReadFields(); if (fields != null) { tideNotifications.AddRange(notificationFactory.GetTideNotifications(tideParser.ParseTides(fields))); } } } return tideNotifications; }