public void InitializeAssemblies_BuildsMaps()
        {
            MappingRepoDictionary.InitializeAssemblies(GetType().Assembly);
            var map = MappingRepoDictionary.GetMap <SimpleObject>();

            Assert.IsNotNull(map);
        }
        public void Sanity2()
        {
            MappingRepoDictionary.InitializeAssemblies(GetType().Assembly);
            MappingRepoDictionary.InitializeAssemblies(GetType().Assembly);

            var customTypeObject = new CustomTypeObject();
            var property         = MappingRepo <CustomTypeObject> .GetMap().Properties[0];

            property.SetValue(customTypeObject, "5,3");
            CollectionAssert.AreEqual(customTypeObject.SomeIntArray, new[] { 5, 3 });
            Assert.AreEqual(property.ValueAccessor(customTypeObject), "5,3");
        }
Exemple #3
0
        public void FixtureSetUp()
        {
            using (var conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySql"].ConnectionString))
            {
                conn.Open();
                var command = conn.CreateCommand();
                command.CommandText =
                    @"DROP TABLE IF EXISTS `location`;
					CREATE TABLE `location` (
					  `zip` varchar(20) NOT NULL,
					  `city` varchar(50),
					  `latitude` double,
					  `longitude` double,
					  `Extra` varchar(50),
					  `AnnoyingInterface` varchar(50),
					  PRIMARY KEY (`zip`)
					) ENGINE=InnoDB DEFAULT CHARSET=utf8;"                    ;
                command.ExecuteNonQuery();
            }

            MappingRepoDictionary.InitializeAssemblies(GetType().Assembly);
        }
 public static void Initialize(params Assembly[] assemblies)
 {
     MappingRepoDictionary.InitializeAssemblies(assemblies);
 }