Ejemplo n.º 1
0
        public void GetMatches_AddedBeforeIndexInitialization_FoundViaPredicate()
        {
            using (var r = AnnotationRepository.FromString("id", @"<notes version='0'></notes>"))
            {
                var ann = new Annotation("conflict", "blah://blah?rid=12345", "somepath");
                ann.AddMessage("merger", "open", string.Empty);
                r.AddAnnotation(ann);

                var index = new IndexOfAllOpenConflicts();
                r.AddObserver(index, _progress);
                Assert.AreEqual(1, index.GetMatches(rf => rf.Contains("rid=12345"), _progress).Count());
                Assert.AreEqual(0, index.GetMatches(rf => rf.Contains("rid=333"), _progress).Count());
                ann.SetStatusToClosed("testman");
                Assert.AreEqual(0, index.GetMatches(rf => rf.Contains("rid=12345"), _progress).Count());
            }
        }