Permalink
Browse files

Fixing tests

  • Loading branch information...
1 parent 111f2b0 commit b8e9c414d1569dda69bd5d1c59524f668d0ce402 @ayende ayende committed Feb 14, 2014
@@ -954,7 +954,7 @@ private void AssertAttachmentPutOperationNotVetoed(string key, RavenJObject meta
.FirstOrDefault(x => x.VetoResult.IsAllowed == false);
if (vetoResult != null)
{
- throw new OperationVetoedException("PUT vetoed on attachment " + key + "by " + vetoResult.Trigger +
+ throw new OperationVetoedException("PUT vetoed on attachment " + key + " by " + vetoResult.Trigger +
" because: " + vetoResult.VetoResult.Reason);
}
}
@@ -211,6 +211,9 @@ private static void FillCache(IndexSearcherHolder.IndexSearcherHoldingState stat
if (reader.IsDeleted(termDocs.Doc))
continue;
+ if (items[termDocs.Doc] == null)
+ items[termDocs.Doc] = new LinkedList<IndexSearcherHolder.IndexSearcherHoldingState.CacheVal>();
+
items[termDocs.Doc].AddLast(new IndexSearcherHolder.IndexSearcherHoldingState.CacheVal
{
Term = termEnum.Term
@@ -50,7 +50,7 @@ public void id_with_backslash_remote()
var throws = Assert.Throws<InvalidOperationException>(()=>session.SaveChanges());
- Assert.Contains(@"PUT vetoed by Raven.Database.Plugins.Builtins.InvalidDocumentNames because: Document names cannot contains '\' but attempted to save with: bad\one", throws.Message);
+ Assert.Contains(@"PUT vetoed on document bad\one by Raven.Database.Plugins.Builtins.InvalidDocumentNames because: Document names cannot contains '\' but attempted to save with: bad\one", throws.Message);
}
}
}
@@ -38,7 +38,7 @@ public void CanVetoDeletes()
{
db.PutStatic("ayende", null, new MemoryStream(new byte[] { 1, 2, 3 }), new RavenJObject());
var operationVetoedException = Assert.Throws<OperationVetoedException>(()=>db.DeleteStatic("ayende", null));
- Assert.Equal("DELETE vetoed by Raven.Tests.Triggers.AttachmentDeleteTrigger+RefuseAttachmentDeleteTrigger because: Can't delete attachments", operationVetoedException.Message);
+ Assert.Equal("PUT vetoed on attachment ayende by Raven.Tests.Triggers.AttachmentDeleteTrigger+RefuseAttachmentDeleteTrigger because: Can't delete attachments", operationVetoedException.Message);
}
public class RefuseAttachmentDeleteTrigger: AbstractAttachmentDeleteTrigger
@@ -51,7 +51,7 @@ public void CanVetoAttachmentPut()
db.PutStatic("ayende", null, new MemoryStream(new byte[] { 1, 2, 3, 4, 5, 6 }),
new RavenJObject()));
- Assert.Equal("PUT vetoed by Raven.Tests.Triggers.RefuseBigAttachmentPutTrigger because: Attachment is too big", operationVetoedException.Message);
+ Assert.Equal("PUT vetoed on attachment ayende by Raven.Tests.Triggers.RefuseBigAttachmentPutTrigger because: Attachment is too big", operationVetoedException.Message);
}
}
}

0 comments on commit b8e9c41

Please sign in to comment.