Beispiel #1
0
        public void CdmEntityDefinitionAttributeHasTraitContainsSingleArgument()
        {
            var generator  = BuildCdmEntityGenerator();
            var annotation = new TraitAnnotation("something");
            var table      = new Table("Customer")
                             .WithColumn("ID", SqlDbType.Int, annotation: annotation);

            annotation.AddArgument("key", "value");

            var entity = generator.GenerateEntity(table);
            var traits = entity.Attributes.First().AppliedTraits;
            var trait  = traits.Single();

            Assert.Single(trait.Arguments);
        }
Beispiel #2
0
        public void CdmEntityDefinitionAttributeHasTraitContainsArgument(string key, dynamic value)
        {
            var generator  = BuildCdmEntityGenerator();
            var annotation = new TraitAnnotation("something");
            var table      = new Table("Customer")
                             .WithColumn("ID", SqlDbType.Int, annotation: annotation);

            annotation.AddArgument(key, value);

            var entity   = generator.GenerateEntity(table);
            var traits   = entity.Attributes.First().AppliedTraits;
            var argument = traits.Single().Arguments.Single();

            Assert.Equal(key, argument.Name);
            Assert.Equal(value, argument.Value);
        }