protected ModelHashingPrivateSetNoneParent(
            bool parentBoolProperty,
            int parentIntProperty,
            string parentStringProperty,
            Guid parentGuidProperty,
            DateTime parentDateTimeProperty,
            CustomEnum parentCustomEnumProperty,
            CustomFlagsEnum parentCustomFlagsEnumProperty,
            CustomClass parentCustomClassProperty,
            CustomBaseClass parentCustomBaseClassProperty,
            CustomGenericClass <CustomClass> parentCustomGenericClassOfCustomClassProperty)
        {
            new { parentStringProperty }.AsArg().Must().NotBeNullNorWhiteSpace();
            new { parentCustomClassProperty }.AsArg().Must().NotBeNull();
            new { parentCustomBaseClassProperty }.AsArg().Must().NotBeNull();
            new { parentCustomGenericClassOfCustomClassProperty }.AsArg().Must().NotBeNull();

            this.ParentBoolProperty            = parentBoolProperty;
            this.ParentIntProperty             = parentIntProperty;
            this.ParentStringProperty          = parentStringProperty;
            this.ParentGuidProperty            = parentGuidProperty;
            this.ParentDateTimeProperty        = parentDateTimeProperty;
            this.ParentCustomEnumProperty      = parentCustomEnumProperty;
            this.ParentCustomFlagsEnumProperty = parentCustomFlagsEnumProperty;
            this.ParentCustomClassProperty     = parentCustomClassProperty;
            this.ParentCustomBaseClassProperty = parentCustomBaseClassProperty;
            this.ParentCustomGenericClassOfCustomClassProperty = parentCustomGenericClassOfCustomClassProperty;
        }
        public ModelAllPrivateSetNone(
            bool boolProperty,
            int intProperty,
            string stringProperty,
            Guid guidProperty,
            DateTime dateTimeProperty,
            CustomEnum customEnumProperty,
            CustomFlagsEnum customFlagsEnumProperty,
            CustomClass customClassProperty,
            CustomBaseClass customBaseClassProperty,
            CustomGenericClass <CustomClass> customGenericClassOfCustomClassProperty)
        {
            new { stringProperty }.AsArg().Must().NotBeNullNorWhiteSpace();
            new { customClassProperty }.AsArg().Must().NotBeNull();
            new { customBaseClassProperty }.AsArg().Must().NotBeNull();
            new { customGenericClassOfCustomClassProperty }.AsArg().Must().NotBeNull();

            this.BoolProperty            = boolProperty;
            this.IntProperty             = intProperty;
            this.StringProperty          = stringProperty;
            this.GuidProperty            = guidProperty;
            this.DateTimeProperty        = dateTimeProperty;
            this.CustomEnumProperty      = customEnumProperty;
            this.CustomFlagsEnumProperty = customFlagsEnumProperty;
            this.CustomClassProperty     = customClassProperty;
            this.CustomBaseClassProperty = customBaseClassProperty;
            this.CustomGenericClassOfCustomClassProperty = customGenericClassOfCustomClassProperty;
        }
        public ModelAllPrivateSetNone DeepCloneWithCustomBaseClassProperty(CustomBaseClass customBaseClassProperty)
        {
            var result = new ModelAllPrivateSetNone(
                this.BoolProperty.DeepClone(),
                this.IntProperty.DeepClone(),
                this.StringProperty?.DeepClone(),
                this.GuidProperty.DeepClone(),
                this.DateTimeProperty.DeepClone(),
                this.CustomEnumProperty.DeepClone(),
                this.CustomFlagsEnumProperty.DeepClone(),
                this.CustomClassProperty?.DeepClone(),
                customBaseClassProperty,
                this.CustomGenericClassOfCustomClassProperty?.DeepClone());

            return(result);
        }
Example #4
0
        /// <inheritdoc />
        public override RelativeSortOrder CompareToForRelativeSortOrder(CustomBaseClass other)
        {
            if (ReferenceEquals(other, null))
            {
                return(RelativeSortOrder.ThisInstanceFollowsTheOtherInstance);
            }

            if (!(other is CustomDerivedClass otherAsCustomDerivedClass))
            {
                throw new ArgumentException(Invariant($"Attempting to compare objects of different types.  This object is of type 'CustomDerivedClass' whereas the other object is of type '{other.GetType().ToStringReadable()}'."));
            }

            var result = this.CompareToForRelativeSortOrder(otherAsCustomDerivedClass);

            return(result);
        }
Example #5
0
        public ModelAllPublicSetNone DeepCloneWithCustomBaseClassProperty(CustomBaseClass customBaseClassProperty)
        {
            var result = new ModelAllPublicSetNone
            {
                BoolProperty            = this.BoolProperty.DeepClone(),
                IntProperty             = this.IntProperty.DeepClone(),
                StringProperty          = this.StringProperty?.DeepClone(),
                GuidProperty            = this.GuidProperty.DeepClone(),
                DateTimeProperty        = this.DateTimeProperty.DeepClone(),
                CustomEnumProperty      = this.CustomEnumProperty.DeepClone(),
                CustomFlagsEnumProperty = this.CustomFlagsEnumProperty.DeepClone(),
                CustomClassProperty     = this.CustomClassProperty?.DeepClone(),
                CustomBaseClassProperty = customBaseClassProperty,
                CustomGenericClassOfCustomClassProperty = this.CustomGenericClassOfCustomClassProperty?.DeepClone(),
            };

            return(result);
        }
Example #6
0
        public ModelStringRepresentationPrivateSetNoneChild2(
            bool parentBoolProperty,
            int parentIntProperty,
            string parentStringProperty,
            Guid parentGuidProperty,
            DateTime parentDateTimeProperty,
            CustomEnum parentCustomEnumProperty,
            CustomFlagsEnum parentCustomFlagsEnumProperty,
            CustomClass parentCustomClassProperty,
            CustomBaseClass parentCustomBaseClassProperty,
            CustomGenericClass <CustomClass> parentCustomGenericClassOfCustomClassProperty,
            bool child2BoolProperty,
            int child2IntProperty,
            string child2StringProperty,
            Guid child2GuidProperty,
            DateTime child2DateTimeProperty,
            CustomEnum child2CustomEnumProperty,
            CustomFlagsEnum child2CustomFlagsEnumProperty,
            CustomClass child2CustomClassProperty,
            CustomBaseClass child2CustomBaseClassProperty,
            CustomGenericClass <CustomClass> child2CustomGenericClassOfCustomClassProperty)
            : base(parentBoolProperty, parentIntProperty, parentStringProperty, parentGuidProperty, parentDateTimeProperty, parentCustomEnumProperty, parentCustomFlagsEnumProperty, parentCustomClassProperty, parentCustomBaseClassProperty, parentCustomGenericClassOfCustomClassProperty)
        {
            new { child2StringProperty }.AsArg().Must().NotBeNullNorWhiteSpace();
            new { child2CustomClassProperty }.AsArg().Must().NotBeNull();
            new { child2CustomBaseClassProperty }.AsArg().Must().NotBeNull();
            new { child2CustomGenericClassOfCustomClassProperty }.AsArg().Must().NotBeNull();

            this.Child2BoolProperty            = child2BoolProperty;
            this.Child2IntProperty             = child2IntProperty;
            this.Child2StringProperty          = child2StringProperty;
            this.Child2GuidProperty            = child2GuidProperty;
            this.Child2DateTimeProperty        = child2DateTimeProperty;
            this.Child2CustomEnumProperty      = child2CustomEnumProperty;
            this.Child2CustomFlagsEnumProperty = child2CustomFlagsEnumProperty;
            this.Child2CustomClassProperty     = child2CustomClassProperty;
            this.Child2CustomBaseClassProperty = child2CustomBaseClassProperty;
            this.Child2CustomGenericClassOfCustomClassProperty = child2CustomGenericClassOfCustomClassProperty;
        }
Example #7
0
 public virtual ModelCloningPublicSetNoneParent DeepCloneWithParentCustomBaseClassProperty(CustomBaseClass parentCustomBaseClassProperty)
 {
     throw new NotImplementedException("This method should be abstract.  It was generated as virtual so that you aren't forced to override it when you create a new model that derives from this model.  It will be overridden in the generated designer file.");
 }