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); }
public void ShouldFailOnNullConversionTypeMakeNullableTypeTest() { ReflectionFascade reflectionFascade; MockFactory mockFactory; IDataTypeFascade mockDataTypeFascade; mockFactory = new MockFactory(); mockDataTypeFascade = mockFactory.CreateInstance <IDataTypeFascade>(); reflectionFascade = new ReflectionFascade(mockDataTypeFascade); reflectionFascade.MakeNullableType(null); }
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); }
public void ShouldFailOnNullConversionTypeMakeNullableTypeTest() { ReflectionFascade reflectionFascade; MockFactory mockFactory; IDataTypeFascade mockDataTypeFascade; mockFactory = new MockFactory(); mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>(); reflectionFascade = new ReflectionFascade(mockDataTypeFascade); reflectionFascade.MakeNullableType(null); }