Ejemplo n.º 1
0
        public void TestPocoCreateAndLoadAndDeleteRecord()
        {
            using (ODatabase database = new ODatabase(_hostname, _port, _databaseName, ODatabaseType.Document, _username, _password))
            {
                TestClass foo = new TestClass();
                foo.IsBool = true;

                ORecord recordCreated = database.CreateRecord("TestClass", foo);
                TestClass fooRetrieved = database.LoadRecord<TestClass>(recordCreated.ORID);

                Assert.IsTrue(fooRetrieved.IsBool == foo.IsBool);

                bool isRecordDeleted = database.DeleteRecord(recordCreated.ORID);

                Assert.IsTrue(isRecordDeleted);

                fooRetrieved = null;
                fooRetrieved = database.LoadRecord<TestClass>(recordCreated.ORID);

                Assert.IsTrue(fooRetrieved == null);
            }
        }