Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public IEnumerable <Annotation> ReadAnnotations(DateTime @from, DateTime until)
        {
            var annotationDatabase = AnnotationDatabase.OpenOrCreate(Path.Combine(rootDirectory, "annotations.db"));

            return(annotationDatabase.ReadAnnotations(from, until));
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        public void AddAnnotation(string title, string message)
        {
            var annotationDatabase = AnnotationDatabase.OpenOrCreate(path);

            annotationDatabase.WriteAnnotation(DateTime.UtcNow, title, message);
        }
Ejemplo n.º 5
0
        public IEnumerable <Annotation> List(DateTime @from, DateTime until)
        {
            var annotationDatabase = AnnotationDatabase.OpenOrCreate(path);

            return(annotationDatabase.ReadAnnotations(from, until));
        }