public void CreateProxyTypeTwiceTest() { Type interfaceType = typeof(ITestMessageObjectWInterfaces1); var interfaceTypeBuilder = new ProxyInterfaceTypeBuilder(); Type newClassType = interfaceTypeBuilder.GetProxyType(interfaceType); Type newClassType2 = interfaceTypeBuilder.GetProxyType(interfaceType); Assert.False(newClassType.IsInterface); Assert.True(newClassType.GetInterfaces().Contains(interfaceType)); Assert.That(newClassType, Is.EqualTo(newClassType2)); }
public void ThrowsExceptionIfNotAnInterfaceTest() { Type interfaceType = typeof(TestMessageObjectNoInterface); var interfaceTypeBuilder = new ProxyInterfaceTypeBuilder(); Assert.Throws<ArgumentException>( () => interfaceTypeBuilder.GetProxyType(interfaceType)); }