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

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

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

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            conversionType  = typeof(int);
            nonNullableType = reflectionFascade.MakeNonNullableType(conversionType);
            Assert.AreEqual(typeof(int), nonNullableType);

            conversionType  = typeof(int?);
            nonNullableType = reflectionFascade.MakeNonNullableType(conversionType);
            Assert.AreEqual(typeof(int), nonNullableType);

            conversionType  = typeof(IDisposable);
            nonNullableType = reflectionFascade.MakeNonNullableType(conversionType);
            Assert.AreEqual(typeof(IDisposable), nonNullableType);
        }
Ejemplo n.º 2
0
        public void ShouldFailOnNullConversionTypeMakeNonNullableTypeTest()
        {
            ReflectionFascade reflectionFascade;

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

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

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            reflectionFascade.MakeNonNullableType(null);
        }
Ejemplo n.º 3
0
		public void ShouldMakeNonNullableTypeTest()
		{
			ReflectionFascade reflectionFascade;
			Type conversionType;
			Type nonNullableType;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

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

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			conversionType = typeof(int);
			nonNullableType = reflectionFascade.MakeNonNullableType(conversionType);
			Assert.AreEqual(typeof(int), nonNullableType);

			conversionType = typeof(int?);
			nonNullableType = reflectionFascade.MakeNonNullableType(conversionType);
			Assert.AreEqual(typeof(int), nonNullableType);

			conversionType = typeof(IDisposable);
			nonNullableType = reflectionFascade.MakeNonNullableType(conversionType);
			Assert.AreEqual(typeof(IDisposable), nonNullableType);
		}
Ejemplo n.º 4
0
		public void ShouldFailOnNullConversionTypeMakeNonNullableTypeTest()
		{
			ReflectionFascade reflectionFascade;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

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

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			reflectionFascade.MakeNonNullableType(null);
		}