Ejemplo n.º 1
0
        public void GetId(string formatId, string expectedId)
        {
            string     modelContent = string.Format(_modelTemplate, formatId, "", "");
            ModelQuery query        = new ModelQuery(modelContent);

            query.ParseModel().Id.Should().Be(expectedId);
        }
Ejemplo n.º 2
0
        public void GetExtends(string extends, string expected)
        {
            string[]       expectedDtmis = expected.Split(new[] { "," }, System.StringSplitOptions.RemoveEmptyEntries);
            string         modelContent  = string.Format(_modelTemplate, "", extends, "");
            ModelQuery     query         = new ModelQuery(modelContent);
            IList <string> extendsDtmis  = query.ParseModel().Extends;

            extendsDtmis.Count.Should().Be(expectedDtmis.Length);

            foreach (string dtmi in extendsDtmis)
            {
                expectedDtmis.Should().Contain(dtmi);
            }
        }
Ejemplo n.º 3
0
        public void GetComponentSchema(string contents, string expected)
        {
            string[]       expectedDtmis    = expected.Split(new[] { "," }, System.StringSplitOptions.RemoveEmptyEntries);
            string         modelContent     = string.Format(_modelTemplate, "", "", contents);
            ModelQuery     query            = new ModelQuery(modelContent);
            IList <string> componentSchemas = query.ParseModel().ComponentSchemas;

            componentSchemas.Count.Should().Be(expectedDtmis.Length);

            foreach (string schema in componentSchemas)
            {
                expectedDtmis.Should().Contain(schema);
            }
        }