Ayende @ Rahien

It's a girl

Longest time to first test pass, but it now works

public class DivanDatabaseTest
{
	[Fact]
	public void Can_add_document_to_database()
	{
		using (var instance = new Instance("test"))
		{
			instance.Init();

			using (var sesion = new Session(instance.JetInstance))
			{
				var database = new DivanDatabase(instance, sesion, "test.divan");
				DocumentId[] add = database.Add(
					JObject.Parse("{'name': 'oren', 'email': 'ayende@ayende.com'")
					);

				using (var view = database.OpenDocumentsView())
				{
					var doc = view.FindById(add[0].Id);

					Assert.Equal("oren", (string) doc["name"]);
					Assert.Equal("ayende@ayende.com", (string) doc["email"]);
				}
			}
		}
	}
}

Comments

smhinsey
12/23/2008 06:42 AM by
smhinsey

Is this a couchdb-in-.net project?

Darius Damalakas
12/23/2008 07:26 AM by
Darius Damalakas

Divan :D :D That's a really funny name.

You could also try "RaskladushkaDatabase" or even "MatrasDatabase"

Comments have been closed on this topic.