public void FactoryTest()
        {
            var array   = new object[0];
            var wrapper = ComponentwiseEqualsAndHashcodeWrapper.New(array);

            Assert.That(wrapper.Enumerable, Is.EqualTo(array));
        }
Beispiel #2
0
 public MethodInfoEqualityComparer(MethodAttributes methodAttributeMask)
     : base(
         x => new object[] {
     x.Name, x.ReturnType, x.Attributes & methodAttributeMask, x.IsGenericMethod ? x.GetGenericArguments().Length : 0,
     ComponentwiseEqualsAndHashcodeWrapper.New(x.IsGenericMethod ? new Type[0] : x.GetParameters().Select(pi => pi.ParameterType.IsGenericParameter ? typeof(Object) : pi.ParameterType)),
     ComponentwiseEqualsAndHashcodeWrapper.New(x.IsGenericMethod ? x.GetParameters().Select(pi => pi.ParameterType.IsGenericParameter ? pi.ParameterType.GenericParameterPosition : -1) : new int[0]),
     ComponentwiseEqualsAndHashcodeWrapper.New(x.GetParameters().Select(pi => pi.Attributes))
 })
 {
 }