public void CreateOpen() { var path = Path.GetTempFileName(); var annotationDatabase = AnnotationDatabase.Create(path); var now = DateTime.UtcNow.AddHours(-2); for (var i = 0; i <= 10; ++i) { annotationDatabase.WriteAnnotation(now.AddSeconds(i), "Deployment", "Deployed changeset cf43450d", "platform-backend", "deployment", "production"); annotationDatabase.WriteAnnotation(now.AddSeconds(i * 2), "Deployment Started", "Started deployment of Platform Backend", "deployment", "staging", "rollback"); } // for var annotations = annotationDatabase.ReadAnnotations(now, now.AddMinutes(1)); Assert.AreEqual(20, annotations.Count); }
public IEnumerable <Annotation> ReadAnnotations(DateTime @from, DateTime until) { var annotationDatabase = AnnotationDatabase.OpenOrCreate(Path.Combine(rootDirectory, "annotations.db")); return(annotationDatabase.ReadAnnotations(from, until)); }
public void WriteAnnotation(Annotation annotation) { var annotationDatabase = AnnotationDatabase.OpenOrCreate(Path.Combine(rootDirectory, "annotations.db")); annotationDatabase.WriteAnnotation(annotation.Timestamp, annotation.Title, annotation.Message, annotation.Tags.ToArray()); }
public void AddAnnotation(string title, string message) { var annotationDatabase = AnnotationDatabase.OpenOrCreate(path); annotationDatabase.WriteAnnotation(DateTime.UtcNow, title, message); }
public IEnumerable <Annotation> List(DateTime @from, DateTime until) { var annotationDatabase = AnnotationDatabase.OpenOrCreate(path); return(annotationDatabase.ReadAnnotations(from, until)); }