using Microsoft.VisualStudio.TestTools.UnitTesting;using Raven.Tests.Helpers;using Raven.Abstractions.Data;using Raven.Json.Linq;
namespace BriefBox.UnitTest.RavenTests{ [TestClass] public class RavenDbGenericTests : RavenTestBase { public class TestEntity { public TestEntity() { Children = new TestEntity[0]; }
public string Id { get; set; } public string Value { get; set; } public TestEntity[] Children { get; set; } }
[TestMethod] public void Test() { TestEntity testEntity;
using (var store = NewDocumentStore(configureStore: ds=> ds.Configuration.Storage.Voron.AllowOn32Bits = true)) { using (var session = store.OpenSession()) { testEntity = new TestEntity() { Value = "Roman1" }; session.Store(testEntity); session.SaveChanges();
session.Advanced.DocumentStore.DatabaseCommands.Patch(testEntity.Id, new PatchRequest[] { new PatchRequest() { Name = "Children", Value = RavenJObject.FromObject(new TestEntity() { Value = "Added Child" }), Type = PatchCommandType.Add, } });
var result = session.Load<TestEntity>(testEntity.Id); Assert.AreEqual(1, result.Children.Length); //BLOWS UP HERE }
using (var session = store.OpenSession()) { var result = session.Load<TestEntity>(testEntity.Id); Assert.AreEqual(1, result.Children.Length); //Does not fail if above is commented out } } } }}
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.