Exemplo n.º 1
0
        private void RunDeSerializeTest(IEdmModel expectedModel, IEnumerable <XElement> csdls)
        {
            var actualModel = this.DeSerializeCsdlsToModel(csdls);
            var errors      = new VocabularyModelComparer().CompareModels(expectedModel, actualModel);

            Assert.IsFalse(errors.Any(), "The actual model is not equal to the expected model");
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            this.definitionModel = this.CreateDefinitionModel();

            this.expectedModel = this.CreateApplicationModel();
            this.actualModel   = this.CreateApplicationModel();

            this.comparer = new VocabularyModelComparer();
        }
        public void Initialize()
        {
            this.definitionModel = this.CreateDefinitionModel();

            this.expectedModel = this.CreateApplicationModel();
            this.actualModel = this.CreateApplicationModel();

            this.comparer = new VocabularyModelComparer();
        }
        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.º 5
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");
            }
        }