Example #1
0
        public static CompositeType CreateRandom(bool createInner = true)
        {
            Random rnd = new Random();
            CompositeType type = new CompositeType();
            type.Int = rnd.Next();
            type.Double = rnd.NextDouble();
            type.Bool = rnd.Next(0, 10) % 2 == 0;
            type.DateTime = DateTime.UtcNow;
            type.List = new List<string>();

            for (int i = 0; i < rnd.Next(0, 20); i++)
            {
                type.List.Add(rnd.Next().ToString());
            }

            if (createInner)
            {
                type.Inner = new List<CompositeType>();

                for (int i = 0; i < rnd.Next(0, 20); i++)
                {
                    type.Inner.Add(CreateRandom(false));
                }
            }

            return type;
        }
Example #2
0
        protected bool Equals(CompositeType other)
        {
            if (!List.EmptyIfNull().SequenceEqual(other.List.EmptyIfNull()))
            {
                return false;
            }

            if (!Inner.EmptyIfNull().SequenceEqual(other.Inner.EmptyIfNull()))
            {
                return false;
            }

            return Int == other.Int && Double == other.Double && DateTime.Equals(other.DateTime) && Bool.Equals(other.Bool);
        }
 public virtual Task MethodWithManyArgumentsAsync(CompositeType arg1, CompositeType arg2, DateTime time)
 {
     return this.SendAsync(__MethodWithManyArgumentsAction, arg1, arg2, time);
 }
 public virtual void MethodWithManyArguments(CompositeType arg1, CompositeType arg2, DateTime time)
 {
     this.Send(__MethodWithManyArgumentsAction, arg1, arg2, time);
 }
 public virtual Task SimpleMethodWithComplexParameterAsync(CompositeType compositeType)
 {
     return this.SendAsync(__SimpleMethodWithComplexParameterAction, compositeType);
 }
 public virtual void SimpleMethodWithComplexParameter(CompositeType compositeType)
 {
     this.Send(__SimpleMethodWithComplexParameterAction, compositeType);
 }