// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. // Unit tests for document. #include #include #include #include #include using namespace document; namespace { TEST("require that document with id schema 'id' checks type") { TestDocRepo repo; const DataType *type = repo.getDocumentType("testdoctype1"); ASSERT_TRUE(type); Document(*type, DocumentId("id:ns:testdoctype1::")); // Should not throw EXPECT_EXCEPTION(Document(*type, DocumentId("id:ns:type::")), vespalib::IllegalArgumentException, "testdoctype1 that don't match the id (type type)"); } } // namespace TEST_MAIN() { TEST_RUN_ALL(); }