public NewReferenceTypeExpressionSlim3(ConstructorInfoSlim constructor, ExpressionSlim arg0, ExpressionSlim arg1, ExpressionSlim arg2)
     : base(constructor)
 {
     _arg0 = arg0;
     _arg1 = arg1;
     _arg2 = arg2;
 }
        public static NewExpressionSlim New(ConstructorInfoSlim constructor, ExpressionSlim arg0)
        {
            Require(constructor, nameof(constructor));
            Require(arg0, nameof(arg0));

            return(new NewReferenceTypeExpressionSlim1(constructor, arg0));
        }
Ejemplo n.º 3
0
        public void MemberInfoSlimEqualityComparer_Constructor()
        {
            var tq = new TypeSlimEqualityComparer();
            var eq = new MemberInfoSlimEqualityComparer(tq);

            var dt = typeof(DateTime).ToTypeSlim();
            var i4 = typeof(int).ToTypeSlim();
            var i8 = typeof(long).ToTypeSlim();
            var ts = typeof(TimeSpan).ToTypeSlim();

            var dtct3_0 = new ConstructorInfoSlim(dt, new List <TypeSlim> {
                i4, i4, i4
            }.AsReadOnly());
            var dtct6_0 = new ConstructorInfoSlim(dt, new List <TypeSlim> {
                i4, i4, i4, i4, i4, i4
            }.AsReadOnly());
            var tsct3_0 = new ConstructorInfoSlim(ts, new List <TypeSlim> {
                i4, i4, i4
            }.AsReadOnly());

            var dtct3_1 = new ConstructorInfoSlim(dt, new List <TypeSlim> {
                i4, i4, i4
            }.AsReadOnly());
            var dtct6_1 = new ConstructorInfoSlim(dt, new List <TypeSlim> {
                i4, i4, i4, i4, i4, i4
            }.AsReadOnly());
            var tsct3_1 = new ConstructorInfoSlim(ts, new List <TypeSlim> {
                i4, i4, i4
            }.AsReadOnly());

            var dtct3_2 = new ConstructorInfoSlim(dt, new List <TypeSlim> {
                i4, i8, i4
            }.AsReadOnly());

            Assert.IsTrue(eq.Equals(dtct3_0, dtct3_0));
            Assert.IsTrue(eq.Equals(dtct6_0, dtct6_0));
            Assert.IsTrue(eq.Equals(tsct3_0, tsct3_0));

            Assert.IsTrue(eq.Equals(dtct3_0, dtct3_1));
            Assert.IsTrue(eq.Equals(dtct6_0, dtct6_1));
            Assert.IsTrue(eq.Equals(tsct3_0, tsct3_1));

            Assert.IsTrue(eq.Equals(dtct3_1, dtct3_0));
            Assert.IsTrue(eq.Equals(dtct6_1, dtct6_0));
            Assert.IsTrue(eq.Equals(tsct3_1, tsct3_0));

            Assert.IsFalse(eq.Equals(dtct3_0, dtct6_0));
            Assert.IsFalse(eq.Equals(dtct6_0, dtct3_0));
            Assert.IsFalse(eq.Equals(dtct3_0, tsct3_0));
            Assert.IsFalse(eq.Equals(tsct3_0, dtct3_0));

            Assert.IsFalse(eq.Equals(dtct3_0, dtct3_2));
            Assert.IsFalse(eq.Equals(dtct3_2, dtct3_0));

            Assert.AreEqual(eq.GetHashCode(dtct3_0), eq.GetHashCode(dtct3_1));
            Assert.AreEqual(eq.GetHashCode(dtct6_0), eq.GetHashCode(dtct6_1));
            Assert.AreEqual(eq.GetHashCode(tsct3_0), eq.GetHashCode(tsct3_1));
        }
 public NewReferenceTypeExpressionSlim5(ConstructorInfoSlim constructor, ExpressionSlim arg0, ExpressionSlim arg1, ExpressionSlim arg2, ExpressionSlim arg3, ExpressionSlim arg4)
     : base(constructor)
 {
     _arg0 = arg0;
     _arg1 = arg1;
     _arg2 = arg2;
     _arg3 = arg3;
     _arg4 = arg4;
 }
        public static NewExpressionSlim New(ConstructorInfoSlim constructor, ExpressionSlim arg0, ExpressionSlim arg1, ExpressionSlim arg2, ExpressionSlim arg3, ExpressionSlim arg4)
        {
            Require(constructor, nameof(constructor));
            Require(arg0, nameof(arg0));
            Require(arg1, nameof(arg1));
            Require(arg2, nameof(arg2));
            Require(arg3, nameof(arg3));
            Require(arg4, nameof(arg4));

            return(new NewReferenceTypeExpressionSlim5(constructor, arg0, arg1, arg2, arg3, arg4));
        }
Ejemplo n.º 6
0
 public FullNewReferenceTypeExpressionSlimWithMembers(ConstructorInfoSlim constructor, ReadOnlyCollection <ExpressionSlim> arguments, ReadOnlyCollection <MemberInfoSlim> members)
     : base(constructor, arguments)
 {
     Members = members;
 }
Ejemplo n.º 7
0
 public FullNewReferenceTypeExpressionSlim(ConstructorInfoSlim constructor, ReadOnlyCollection <ExpressionSlim> arguments)
     : base(constructor)
 {
     _arguments = arguments;
 }
Ejemplo n.º 8
0
 public NewReferenceTypeExpressionSlim0(ConstructorInfoSlim constructor)
     : base(constructor)
 {
 }
Ejemplo n.º 9
0
 internal NewReferenceTypeExpressionSlim(ConstructorInfoSlim constructor)
 {
     Constructor = constructor;
 }
Ejemplo n.º 10
0
 private static void AssertAreSameConstructor(ConstructorInfo constructorInfo, ConstructorInfoSlim constructorInfoSlim)
 {
     Assert.IsTrue(TypeSlimExtensions.Equals(constructorInfo.DeclaringType.ToTypeSlim(), constructorInfoSlim.DeclaringType));
     Assert.IsTrue(constructorInfoSlim.ParameterTypes.SequenceEqual(constructorInfo.GetParameters().Select(p => p.ParameterType.ToTypeSlim())));
 }
Ejemplo n.º 11
0
 public ConstructorDef(TypeRef declaringType, ConstructorInfoSlim constructor, params TypeRef[] parameters)
     : base(declaringType)
 {
     _constructor = constructor;
     _parameters  = parameters;
 }
 public static NewExpressionSlim New(ConstructorInfoSlim constructor, ExpressionSlim arg0, ExpressionSlim arg1)
 {
     return(new NewReferenceTypeExpressionSlim2(constructor, arg0, arg1));
 }
 public static NewExpressionSlim New(ConstructorInfoSlim constructor)
 {
     return(new NewReferenceTypeExpressionSlim0(constructor));
 }
 public NewReferenceTypeExpressionSlim1(ConstructorInfoSlim constructor, ExpressionSlim arg0)
     : base(constructor)
 {
     _arg0 = arg0;
 }
Ejemplo n.º 15
0
 protected override int VisitConstructor(ConstructorInfoSlim constructor) => throw new NotImplementedException();
Ejemplo n.º 16
0
 protected override int VisitConstructor(ConstructorInfoSlim constructor) => Combine((int)constructor.MemberType, Visit(constructor.DeclaringType), Visit(constructor.ParameterTypes));
 public static NewExpressionSlim New(ConstructorInfoSlim constructor, ExpressionSlim arg0, ExpressionSlim arg1, ExpressionSlim arg2, ExpressionSlim arg3, ExpressionSlim arg4)
 {
     return(new NewReferenceTypeExpressionSlim5(constructor, arg0, arg1, arg2, arg3, arg4));
 }