Esempio n. 1
0
        public void IsMapped_False_Test()
        {
            // Arrange
            TypeMapImpl target = new TypeMapImpl();

            target.Add(typeof(long), typeof(DateTime));

            // Act
            bool actual = target.IsMapped(typeof(double));

            // Arrange
            Assert.IsFalse(actual);
        }
Esempio n. 2
0
        public void GetComponentType_NotMapped_Test()
        {
            // Arrange
            TypeMapImpl target = new TypeMapImpl();

            target.Add(typeof(long), typeof(DateTime));

            // Act
            Type actual = target.GetComponentType(typeof(float));

            // Arrange
            Assert.AreEqual(typeof(float), actual);
        }
Esempio n. 3
0
        /// <summary>
        /// 既定の設定で初期化
        /// </summary>
        public static void InitializeDefault()
        {
            Config           = null;
            Container        = new QuillContainer();
            TypeMap          = new TypeMapImpl();
            ComponentCreator = new ComponentCreators();
            Injector         = new QuillInjector();
            InjectionFilter  = new InjectionFilterBase();
            Message          = QuillMessage.CreateForJPN();
            OutputLog        = OutputLogToConsole;

            // SQL Server用パラメータマーク
            ReplaceToParamMark = (paramName) => "@" + paramName;
        }
Esempio n. 4
0
        public void AddTest()
        {
            // Arragne
            TypeMapImpl target = new TypeMapImpl();

            // Act
            target.Add(typeof(int), typeof(string));

            // Assert
            FieldInfo field  = typeof(TypeMapImpl).GetField("_typeMap", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
            object    actual = field.GetValue(target);

            Assert.IsNotNull(actual);
            Assert.IsTrue(typeof(IDictionary <Type, Type>).IsAssignableFrom(actual.GetType()));

            IDictionary <Type, Type> actualValue = (IDictionary <Type, Type>)actual;

            Assert.AreEqual(typeof(string), actualValue[typeof(int)]);
        }
Esempio n. 5
0
        public gov.cca.ComponentID createInstance(string instanceName, string className, gov.cca.TypeMap properties)
        {
            gov.cca.ComponentID cid = null;

            try
            {
                ManagerObject manager = backend.DGAC.BackEnd.connectToManager(out ch);

                TypeMap map = new TypeMapImpl(properties);

                cid = manager.createInstance(instanceName, className, map);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("ERROR Creating Instance !");
            }
            finally
            {
                backend.DGAC.BackEnd.releaseManager(ch);
            }

            return(cid);
        }