protected Event(GRLocation location, string dateTimeStamp, int ID, string eventType) { this.eventLocation = location; this.dateTimeStamp = dateTimeStamp; this.ID = ID; this.eventType = eventType; }
public void GetLocationTest() { GRLocation expectedLocation = new GRLocation(10, 12); TweetEvent te = new TweetEvent(expectedLocation, "dateTime", "some text"); GRLocation eventLocation = te.EventLocation; Assert.AreEqual(expectedLocation, eventLocation); }
public void GRLocationTest() { double lat = 0; double longt = 0; GRLocation location1 = new GRLocation(lat, longt); Assert.AreEqual(lat, location1.Latitude); Assert.AreEqual(longt, location1.Longitude); }
private static GRLocation GetLocationFromNode(XmlNode parent, XmlNamespaceManager nsmgr) { XmlNode locationNode = GetNodeWithTag("location", parent, nsmgr); XmlNode latNode = GetNodeWithTag("lat", locationNode, nsmgr); XmlNode longNode = GetNodeWithTag("long", locationNode, nsmgr); GRLocation location = new GRLocation(Convert.ToDouble(latNode.InnerText), Convert.ToDouble(longNode.InnerText)); return(location); }
public void SetLocationTest() { GRLocation original = new GRLocation(0, 0); GRLocation expectedLocation = new GRLocation(10, 12); TweetEvent te = new TweetEvent(original, "dateTime", "some text"); te.EventLocation = expectedLocation; Assert.AreEqual(expectedLocation, te.EventLocation); }
private static StatusUpdateEvent ProcessStatusEvent(XmlNode eventNode, XmlNode statusNode, XmlNamespaceManager nsmgr) { XmlNode idNode = GetNodeWithTag("eventid", eventNode, nsmgr); XmlNode dateTimeNode = GetNodeWithTag("datetimestamp", statusNode, nsmgr); XmlNode statusTextNode = GetNodeWithTag("text", statusNode, nsmgr); string stringID = idNode.InnerText.Substring(2); int ID = Convert.ToInt32(stringID); GRLocation location = GetLocationFromNode(statusNode, nsmgr); return(new StatusUpdateEvent(location, dateTimeNode.InnerText, statusTextNode.InnerText, ID)); }
private static PhotoEvent ProcessPhotoEvent(XmlNode eventNode, XmlNode photoEventNode, XmlNamespaceManager nsmgr) { XmlNode idNode = GetNodeWithTag("eventid", eventNode, nsmgr); XmlNode dateTimeNode = GetNodeWithTag("datetimestamp", photoEventNode, nsmgr); XmlNode photoNode = GetNodeWithTag("photo", photoEventNode, nsmgr); XmlNode filepathNode = GetNodeWithTag("filepath", photoEventNode, nsmgr); GRLocation location = GetLocationFromNode(photoEventNode, nsmgr); string stringID = idNode.InnerText.Substring(2); int ID = Convert.ToInt32(stringID); return(new PhotoEvent(location, dateTimeNode.InnerText, filepathNode.InnerText, ID)); }
private static void Write(string ns, XmlTextWriter writer, GRLocation location) { writer.WriteStartElement(ns + "location"); writer.WriteStartElement(ns + "lat"); writer.WriteString(location.Latitude.ToString()); writer.WriteEndElement(); writer.WriteStartElement(ns + "long"); writer.WriteString(location.Longitude.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); }
private static VideoEvent ProcessVideoEvent(XmlNode eventNode, XmlNode videoEventNode, XmlNamespaceManager nsmgr) { XmlNode idNode = GetNodeWithTag("eventid", eventNode, nsmgr); XmlNode startTimeNode = GetNodeWithTag("start-time", videoEventNode, nsmgr); XmlNode endTimeNode = GetNodeWithTag("end-time", videoEventNode, nsmgr); XmlNode dtStartNode = GetNodeWithTag("datetimestamp", startTimeNode, nsmgr); XmlNode dtEndNode = GetNodeWithTag("datetimestamp", endTimeNode, nsmgr); XmlNode filepathNode = GetNodeWithTag("filepath", videoEventNode, nsmgr); GRLocation location = GetLocationFromNode(videoEventNode, nsmgr); string stringID = idNode.InnerText.Substring(2); int ID = Convert.ToInt32(stringID); return(new VideoEvent(location, filepathNode.InnerText, dtStartNode.InnerText, dtEndNode.InnerText, ID)); }
public StatusUpdateEvent(GRLocation location, string dateTimeStamp, string text, int ID) : base(location, dateTimeStamp, ID, "STATUS") { this.statusText = text; }
public PhotoEvent(GRLocation location, string dateTimeStamp, string photoFilePath, int ID) : base(location, dateTimeStamp, ID, "PHOTO") { this.photoFilePath = photoFilePath; }
public TweetEvent(GRLocation location, string dateTimeStamp, string tweetText, int ID) : base(location, dateTimeStamp, ID, "TWEET") { this.tweetText = tweetText; }