forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProjectionShouldNotLoadDocument.cs
33 lines (30 loc) · 1.22 KB
/
ProjectionShouldNotLoadDocument.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// -----------------------------------------------------------------------
// <copyright file="ProjectionShouldNotLoadDocument.cs" company="Hibernating Rhinos LTD">
// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
using Raven.Abstractions.Data;
using Raven.Json.Linq;
using Raven.Tests.Common;
using Xunit;
namespace Raven.Tests.MailingList
{
public class ProjectionShouldNotLoadDocument : RavenTest
{
[Fact]
public void WhenProjecting()
{
using (var store = NewDocumentStore())
{
store.SystemDatabase.Documents.Put("FOO", null, new RavenJObject { { "Name", "Ayende" } }, new RavenJObject(), null);
WaitForIndexing(store);
var result = store.DatabaseCommands.Query("dynamic", new IndexQuery
{
FieldsToFetch = new[] { "Name" }
}, new string[0]);
// if this is lower case, then we loaded this from the index, not from the db
Assert.Equal("foo", result.Results[0].Value<string>(Constants.DocumentIdFieldName));
}
}
}
}