Ejemplo n.º 1
0
        public void ShouldMakeNullableTypeTest()
        {
            ReflectionFascade reflectionFascade;
            Type conversionType;
            Type nullableType;

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

            mockFactory         = new MockFactory();
            mockDataTypeFascade = mockFactory.CreateInstance <IDataTypeFascade>();

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            conversionType = typeof(int);
            nullableType   = reflectionFascade.MakeNullableType(conversionType);
            Assert.AreEqual(typeof(int?), nullableType);

            conversionType = typeof(int?);
            nullableType   = reflectionFascade.MakeNullableType(conversionType);
            Assert.AreEqual(typeof(int?), nullableType);

            conversionType = typeof(IDisposable);
            nullableType   = reflectionFascade.MakeNullableType(conversionType);
            Assert.AreEqual(typeof(IDisposable), nullableType);
        }
Ejemplo n.º 2
0
        public void ShouldFailOnNullConversionTypeMakeNullableTypeTest()
        {
            ReflectionFascade reflectionFascade;

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

            mockFactory         = new MockFactory();
            mockDataTypeFascade = mockFactory.CreateInstance <IDataTypeFascade>();

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            reflectionFascade.MakeNullableType(null);
        }
Ejemplo n.º 3
0
		public void ShouldMakeNullableTypeTest()
		{
			ReflectionFascade reflectionFascade;
			Type conversionType;
			Type nullableType;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

			mockFactory = new MockFactory();
			mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>();

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			conversionType = typeof(int);
			nullableType = reflectionFascade.MakeNullableType(conversionType);
			Assert.AreEqual(typeof(int?), nullableType);

			conversionType = typeof(int?);
			nullableType = reflectionFascade.MakeNullableType(conversionType);
			Assert.AreEqual(typeof(int?), nullableType);

			conversionType = typeof(IDisposable);
			nullableType = reflectionFascade.MakeNullableType(conversionType);
			Assert.AreEqual(typeof(IDisposable), nullableType);
		}
Ejemplo n.º 4
0
		public void ShouldFailOnNullConversionTypeMakeNullableTypeTest()
		{
			ReflectionFascade reflectionFascade;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

			mockFactory = new MockFactory();
			mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>();

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			reflectionFascade.MakeNullableType(null);
		}