コード例 #1
0
 public void SetUp()
 {
     generator       = new PocoEmitGenertor();
     typeMapper      = new DefaultTypeMapper(new Dictionary <ITypeDescription, IGeneratedType>());
     typeDescription = new TypeDescription("Sample.Class", new List <IPropertyDescription>()
     {
         new PropertyDescription("Number", typeof(int)),
         new PropertyDescription("Text", typeof(string))
     });
 }
コード例 #2
0
        public void GenerateTypes_should_load_type_from_disk_default_location()
        {
            generator = new PocoEmitGenertor(true);
            var result = generator.GenerateTypes(new ITypeDescription[]
            {
                new TypeDescription("Type", new List <IPropertyDescription>()
                {
                    new PropertyDescription("Prop", typeof(int))
                })
            }, typeMapper);

            Assert.NotNull(result);
            var first = result.Single();

            Assert.NotNull(first.Type);
            Assert.NotNull(first.Type.Assembly.Location);
        }
コード例 #3
0
        public void GenerateTypes_should_load_type_from_disk()
        {
            generator = new PocoEmitGenertor("test.dll");
            var result = generator.GenerateTypes(new ITypeDescription[]
            {
                new TypeDescription("Type", new List <IPropertyDescription>()
                {
                    new PropertyDescription("Prop", typeof(int))
                })
            }, typeMapper);

            Assert.NotNull(result);
            var first = result.Single();

            Assert.NotNull(first.Type);
            Console.WriteLine(first.Type.Assembly.Location);
            StringAssert.Contains("test.dll", first.Type.Assembly.Location);
        }
コード例 #4
0
        public void GenerateTypes_should_load_type_from_disk()
        {
            generator = new PocoEmitGenertor("test.dll");
            var result = generator.GenerateTypes(new ITypeDescription[]
                {
                    new TypeDescription("Type", new List<IPropertyDescription>()
                        {
                            new PropertyDescription("Prop", typeof(int))
                        })
                }, typeMapper);

            Assert.NotNull(result);
            var first = result.Single();
            Assert.NotNull(first.Type);
            Console.WriteLine(first.Type.Assembly.Location);
            StringAssert.Contains("test.dll", first.Type.Assembly.Location);
        }
コード例 #5
0
 public void SetUp()
 {
     generator = new PocoEmitGenertor();
     typeMapper = new DefaultTypeMapper(new Dictionary<ITypeDescription, IGeneratedType>());
     typeDescription = new TypeDescription("Sample.Class", new List<IPropertyDescription>()
         {
             new PropertyDescription("Number", typeof(int)),
             new PropertyDescription("Text", typeof(string))
         });
 }
コード例 #6
0
        public void GenerateTypes_should_load_type_from_disk_default_location()
        {
            generator = new PocoEmitGenertor(true);
            var result = generator.GenerateTypes(new ITypeDescription[]
                {
                    new TypeDescription("Type", new List<IPropertyDescription>()
                        {
                            new PropertyDescription("Prop", typeof(int))
                        })
                }, typeMapper);

            Assert.NotNull(result);
            var first = result.Single();
            Assert.NotNull(first.Type);
            Assert.NotNull(first.Type.Assembly.Location);
        }