我目前正在 RavenDB 中进行调查并设置这个简单的测试
<TestFixtureSetUp()>
Public Sub Setup()
_embeddableDocumentStore = New EmbeddableDocumentStore With {.DataDirectory = "localdatabase"}
_embeddableDocumentStore.Initialize()
End Sub
<Test> Public Sub CreateDB()
Dim session = _embeddableDocumentStore.OpenSession()
Dim results = session.Query(Of testclass)().ToList()
For Each testclass In results
session.Delete(testclass)
Next
session.SaveChanges()
session.Store(New testclass With {.Id = 4, .Name = "177mdffarsdfdffds6t2in611"})
session.Store(New testclass With {.Id = 2, .Name = "17fd7martrsdfdffds6t2in611"})
session.Store(New testclass With {.Id = 3, .Name = "re177marsdfdfffdfds6t2in611"})
session.SaveChanges()
results = session.Query(Of testclass)().ToList()
For Each testclass In results
session.Delete(testclass)
Next
session.SaveChanges()
results = session.Query(Of testclass)().ToList()
Assert.AreEqual(0, results.Count())
End Sub
<TestFixtureTearDown()>
Public Sub TearDown()
_embeddableDocumentStore.Dispose()
_embeddableDocumentStore = Nothing
End Sub
但是我可以让嵌入式 RavenDB 数据库将调试信息写入 Visual Studio 调试输出吗?我尝试在 bin\debug 文件夹中添加带有此内容的 nlog.config,但是当我调试时,我在输出中没有得到有关查询的信息......我做错了什么?
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.netfx35.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target xsi:type="Console" Name="Console" />
</targets>
<rules>
<logger name="Raven.Client.*" writeTo="Console"/>
</rules>
</nlog>