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))
     });
 }
        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);
        }
        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);
        }
        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);
        }
 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))
         });
 }
        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);
        }