private void VerifyVocabulary(IEdmModel edmModel)
        {
            IEdmModel parsedModel = this.GetParserResult(GetVocabularyCsdls(edmModel));

            var comparer             = new VocabularyModelComparer();
            var compareErrorMessages = comparer.CompareModels(edmModel, parsedModel);

            compareErrorMessages.ToList().ForEach(e => Console.WriteLine(e));
            Assert.AreEqual(0, compareErrorMessages.Count, "comparision errors");
        }
Exemplo n.º 2
0
        private void PerformCustomVocabularySerializerTest(IEdmModel testEdmModel)
        {
            var csdls = new List <XElement>();

            csdls.AddRange(new VocabularyDefinitionCsdlGenerator().GenerateDefinitionCsdl(this.EdmVersion, testEdmModel));
            csdls.Add(new VocabularyApplicationCsdlGenerator().GenerateApplicationCsdl(this.EdmVersion, testEdmModel));

            var expectedModel = this.GetParserResult(csdls);
            var actualModel   = this.GetParserResult(this.GetSerializerResult(expectedModel).Select(XElement.Parse));

            var comparer             = new VocabularyModelComparer();
            var compareErrorMessages = comparer.CompareModels(expectedModel, actualModel);

            compareErrorMessages.ToList().ForEach(Console.WriteLine);
            Assert.AreEqual(0, compareErrorMessages.Count, "Comparison errors");
        }
        public void ConstructibleVocabularyTestOnVocabularyTestModels()
        {
            var stubEdmModels = new EdmLibTestModelExtractor().GetModels <IEdmModel>(typeof(VocabularyTestModelBuilder), this.EdmVersion, new CustomConstructibleVocabularyTestAttribute(), false);

            foreach (var stubEdmModel in stubEdmModels)
            {
                var csdls = new List <XElement>();
                csdls.AddRange(new VocabularyDefinitionCsdlGenerator().GenerateDefinitionCsdl(this.EdmVersion, stubEdmModel.Value));
                csdls.Add(new VocabularyApplicationCsdlGenerator().GenerateApplicationCsdl(this.EdmVersion, stubEdmModel.Value));
                var edmModel = this.GetParserResult(csdls);

                var stockModel           = new EdmToStockModelConverter().ConvertToStockModel(edmModel);
                var comparer             = new VocabularyModelComparer();
                var compareErrorMessages = comparer.CompareModels(edmModel, stockModel);

                compareErrorMessages.ToList().ForEach(e => Console.WriteLine(e));
                Assert.AreEqual(0, compareErrorMessages.Count, "Comparison errors");
            }
        }