public void VocabularySerializingAnnotationsInlineOnEntityContainer() { IEdmModel expectedModel = this.GetParserResult(VocabularyTestModelBuilder.AnnotationsInlineOnEntityContainer()); StringWriter actualResult = new StringWriter(); XmlWriter xw = XmlWriter.Create(actualResult); IEnumerable <EdmError> errors; expectedModel.TryWriteSchema(xw, out errors); xw.Flush(); xw.Close(); Assert.AreNotEqual(string.Empty, actualResult.ToString().Trim(), "The serializer should not generate empty CSDLs"); var actualModel = this.GetParserResult(new XElement[] { XElement.Parse(actualResult.ToString()) }); var actualVocab = actualModel.EntityContainer.VocabularyAnnotations(actualModel); Assert.AreEqual(1, actualVocab.Count(), "Invalid vocabulary annotation count."); }