public void Equals_should_return_value_for_class_with_generic_parameter() { var instance = new WithGenericParameter <GenericClassNormalClass>(); instance.X = 12; instance.A = 1; var propInstance = new GenericClassNormalClass(); var array = new GenericClassNormalClass[1]; array[0] = propInstance; instance.B = array; var instance2 = new WithGenericParameter <GenericClassNormalClass>(); instance2.X = 12; instance2.A = 1; var propInstance2 = new GenericClassNormalClass(); var array2 = new GenericClassNormalClass[1]; array2[0] = propInstance2; instance2.B = array; bool result = instance.Equals(instance2); Assert.True(result); }
public void GetHashCode_should_return_value_for_class_with_generic_parameter() { var instance = new WithGenericParameter <GenericClassNormalClass>(); instance.X = 12; instance.A = 1; var propInstance = new GenericClassNormalClass(); var array = new GenericClassNormalClass[1]; array[0] = propInstance; instance.B = array; var result = instance.GetHashCode(); Assert.NotEqual(0, result); }