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 void CustomEnumIsConverted(CustomEnum value, string serializedValue) { var expected = $"\"{serializedValue}\""; var actual = JsonSerializer.Serialize(value); Assert.AreEqual(expected, actual); }
public static void BitwiseOrRemoveEnumValue() { CustomEnum t = CustomEnum.Value1 | CustomEnum.Value2; t &= ~CustomEnum.Value2; Tracker.Call(t); }
public static void BitwiseOrAddEnumValue() { CustomEnum t = CustomEnum.Value1; t |= CustomEnum.Value2; Tracker.Call((int)t); }
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; }
protected ModelPrivateSetNonGenericParent( string parentStringProperty, int parentIntProperty, CustomEnum parentEnumProperty, CustomClass parentCustomClassProperty, string[] parentArrayProperty, decimal?parentNullableProperty, CustomGenericClass <string> parentCustomGenericClassProperty, IReadOnlyCollection <string> parentReadOnlyCollectionProperty, IReadOnlyDictionary <string, string> parentReadOnlyDictionaryProperty) { new { parentStringProperty }.AsArg().Must().NotBeNullNorWhiteSpace(); new { parentCustomClassProperty }.AsArg().Must().NotBeNull(); new { parentArrayProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { parentCustomGenericClassProperty }.AsArg().Must().NotBeNull(); new { parentReadOnlyCollectionProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { parentReadOnlyDictionaryProperty }.AsArg().Must().NotBeNullNorEmptyDictionaryNorContainAnyNullValues(); this.ParentStringProperty = parentStringProperty; this.ParentIntProperty = parentIntProperty; this.ParentEnumProperty = parentEnumProperty; this.ParentCustomClassProperty = parentCustomClassProperty; this.ParentArrayProperty = parentArrayProperty; this.ParentNullableProperty = parentNullableProperty; this.ParentCustomGenericClassProperty = parentCustomGenericClassProperty; this.ParentReadOnlyCollectionProperty = parentReadOnlyCollectionProperty; this.ParentReadOnlyDictionaryProperty = parentReadOnlyDictionaryProperty; }
public Augment ConvertToScienceObject() => new Augment( name, description, CustomEnum.GetValueFromDescription <Character.BodyPartSlot.SlotType>(slot), CustomEnum.GetValueFromDescription <Character.RaceType>(race), genderInverted, customParams) { Id = id };
public ModelPrivateSetConstructorMissingPropertyChild3( CustomEnum parentEnumProperty, IReadOnlyCollection <string> parentReadOnlyCollectionOfStringProperty, int childIntProperty) : base(parentEnumProperty, parentReadOnlyCollectionOfStringProperty) { this.ChildIntProperty = childIntProperty; }
public void CopyEnum() { const CustomEnum customEnum = CustomEnum.Foo; object copy = ObjectCopier.Copy(customEnum, commandAssembly); Assert.AreNotSame(customEnum, copy); Assert.AreEqual(customEnum, copy); }
public ModelPrivateSetGenericParentGenericChild( string parentStringProperty, int parentIntProperty, CustomEnum parentEnumProperty, CustomClass parentCustomClassProperty, TFirst parentGenericArgumentProperty, TFirst[] parentGenericArrayProperty, TSecond?parentGenericNullableProperty, CustomGenericClass <TSecond> parentGenericCustomGenericClassProperty, IReadOnlyCollection <TFirst> parentGenericReadOnlyCollectionProperty, IReadOnlyList <TFirst> parentGenericReadOnlyListProperty, IReadOnlyDictionary <TFirst, TSecond> parentGenericReadOnlyDictionaryProperty1, IReadOnlyDictionary <TSecond, TFirst> parentGenericReadOnlyDictionaryProperty2, IReadOnlyDictionary <string, TSecond> parentGenericPartiallyClosedReadOnlyDictionaryProperty1, IReadOnlyDictionary <TFirst, string> parentGenericPartiallyClosedReadOnlyDictionaryProperty2, string childStringProperty, int childIntProperty, CustomEnum childEnumProperty, CustomClass childCustomClassProperty, TFirst childGenericArgumentProperty, TFirst[] childGenericArrayProperty, TSecond?childGenericNullableProperty, CustomGenericClass <TSecond> childGenericCustomGenericClassProperty, IReadOnlyCollection <TFirst> childGenericReadOnlyCollectionProperty, IReadOnlyList <TFirst> childGenericReadOnlyListProperty, IReadOnlyDictionary <TFirst, TSecond> childGenericReadOnlyDictionaryProperty1, IReadOnlyDictionary <TSecond, TFirst> childGenericReadOnlyDictionaryProperty2, IReadOnlyDictionary <string, TSecond> childGenericPartiallyClosedReadOnlyDictionaryProperty1, IReadOnlyDictionary <TFirst, string> childGenericPartiallyClosedReadOnlyDictionaryProperty2) : base(parentStringProperty, parentIntProperty, parentEnumProperty, parentCustomClassProperty, parentGenericArgumentProperty, parentGenericArrayProperty, parentGenericNullableProperty, parentGenericCustomGenericClassProperty, parentGenericReadOnlyCollectionProperty, parentGenericReadOnlyListProperty, parentGenericReadOnlyDictionaryProperty1, parentGenericReadOnlyDictionaryProperty2, parentGenericPartiallyClosedReadOnlyDictionaryProperty1, parentGenericPartiallyClosedReadOnlyDictionaryProperty2) { new { childStringProperty }.AsArg().Must().NotBeNullNorWhiteSpace(); new { childCustomClassProperty }.AsArg().Must().NotBeNull(); new { childGenericArgumentProperty }.AsArg().Must().NotBeNull(); new { childGenericArrayProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { childGenericCustomGenericClassProperty }.AsArg().Must().NotBeNull(); new { childGenericReadOnlyCollectionProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { childGenericReadOnlyListProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { childGenericReadOnlyDictionaryProperty1 }.AsArg().Must().NotBeNullNorEmptyDictionary(); new { childGenericReadOnlyDictionaryProperty2 }.AsArg().Must().NotBeNullNorEmptyDictionaryNorContainAnyNullValues(); new { childGenericPartiallyClosedReadOnlyDictionaryProperty1 }.AsArg().Must().NotBeNullNorEmptyDictionary(); new { childGenericPartiallyClosedReadOnlyDictionaryProperty2 }.AsArg().Must().NotBeNullNorEmptyDictionaryNorContainAnyNullValues(); this.ChildStringProperty = childStringProperty; this.ChildIntProperty = childIntProperty; this.ChildEnumProperty = childEnumProperty; this.ChildCustomClassProperty = childCustomClassProperty; this.ChildGenericArgumentProperty = childGenericArgumentProperty; this.ChildGenericArrayProperty = childGenericArrayProperty; this.ChildGenericNullableProperty = childGenericNullableProperty; this.ChildGenericCustomGenericClassProperty = childGenericCustomGenericClassProperty; this.ChildGenericReadOnlyCollectionProperty = childGenericReadOnlyCollectionProperty; this.ChildGenericReadOnlyListProperty = childGenericReadOnlyListProperty; this.ChildGenericReadOnlyDictionaryProperty1 = childGenericReadOnlyDictionaryProperty1; this.ChildGenericReadOnlyDictionaryProperty2 = childGenericReadOnlyDictionaryProperty2; this.ChildGenericPartiallyClosedReadOnlyDictionaryProperty1 = childGenericPartiallyClosedReadOnlyDictionaryProperty1; this.ChildGenericPartiallyClosedReadOnlyDictionaryProperty2 = childGenericPartiallyClosedReadOnlyDictionaryProperty2; }
public void Register_CustomCanvasType_Height_CustomInterface() { CustomCanvasType the_object = new CustomCanvasType(); CustomCanvasType custom_canvas = new CustomCanvasType(); Canvas canvas = new Canvas(); CustomStruct custom_struct_1 = new CustomStruct(1); CustomEnum custom_enum = CustomEnum.EnumValue1; CustomDelegate custom_delegate = delegate { }; CustomInterface custom_interface_a = new CustomInterfaceImplA(); CustomInterface custom_interface_b = new CustomInterfaceImplB(); DependencyProperty property; DependencyPropertyInfo info; DependencyPropertyInfo.ChangedInfo changed_info; InkPresenter ink = new InkPresenter(); // The only builtin type derived from Canvas object actual_value; object previous_expected_value = null; int iterations = 0; int changes = 0; CustomCanvasType_Height_CustomInterface = new DependencyPropertyInfo("Height", typeof(CustomCanvasType), typeof(CustomInterface), true); info = CustomCanvasType_Height_CustomInterface; property = info.Property; Assert.AreEqual(null, the_object.GetValue(property), "Default value 1"); Assert.AreEqual(null, ink.GetValue(property), "Default value 2"); Assert.Throws(delegate { the_object.SetValue(property, 0); }, typeof(ArgumentException)); Assert.Throws(delegate { the_object.SetValue(property, 1); }, typeof(ArgumentException)); Assert.Throws(delegate { the_object.SetValue(property, ""); }, typeof(ArgumentException)); Assert.Throws(delegate { the_object.SetValue(property, new CustomClass()); }, typeof(ArgumentException)); Assert.Throws(delegate { the_object.SetValue(property, new Canvas()); }, typeof(ArgumentException)); Assert.Throws(delegate { the_object.SetValue(property, custom_enum); }, typeof(ArgumentException)); foreach (object expected_value in new object [] { null, custom_interface_a, null, custom_interface_b, custom_interface_b, null }) { iterations++; the_object.SetValue(property, expected_value); actual_value = the_object.GetValue(property); if (!object.Equals(expected_value, previous_expected_value)) { changes++; changed_info = info.Changes [info.Changes.Count - 1]; DependencyPropertyChangedEventArgs args = changed_info.args; Assert.AreEqual(args.OldValue, previous_expected_value, "OldValue"); Assert.AreEqual(args.NewValue, expected_value, "NewValue"); Assert.AreSame(changed_info.obj, the_object); } previous_expected_value = expected_value; Assert.AreEqual(expected_value, actual_value, "Iteration #{0}", iterations); Assert.AreEqual(changes, info.Changes.Count, "Iteration #{0} there should be {1} changes, but there were {2} changes", iterations, changes, info.Changes.Count); } }
protected ModelPrivateSetConstructorMissingPropertyParent( CustomEnum parentEnumProperty, IReadOnlyCollection <string> parentReadOnlyCollectionOfStringProperty) { new { parentReadOnlyCollectionOfStringProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); this.ParentEnumProperty = parentEnumProperty; this.ParentReadOnlyCollectionOfStringProperty = parentReadOnlyCollectionOfStringProperty; }
protected ModelPrivateSetConstructorMoreDerivedThanPropertyParent( CustomEnum parentEnumProperty, CustomMultilevelBaseClass customMultilevelBaseClass) { new { customMultilevelBaseClass }.AsArg().Must().NotBeNull(); this.ParentEnumProperty = parentEnumProperty; this.CustomMultilevelBaseClass = customMultilevelBaseClass; }
public ModelPrivateSetConstructorMoreDerivedThanPropertyChild2( CustomEnum parentEnumProperty, CustomMultilevelChildBaseClass customMultilevelBaseClass, CustomClass childCustomClass) : base(parentEnumProperty, customMultilevelBaseClass) { new { childCustomClass }.AsArg().Must().NotBeNull(); this.ChildCustomClass = childCustomClass; }
public ModelPrivateSetConstructorMoreDerivedThanPropertyChild1( CustomEnum parentEnumProperty, CustomMultilevelChildClass customMultilevelBaseClass, IReadOnlyCollection <string> childReadOnlyCollectionOfStringProperty) : base(parentEnumProperty, customMultilevelBaseClass) { new { childReadOnlyCollectionOfStringProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); this.ChildReadOnlyCollectionOfStringProperty = childReadOnlyCollectionOfStringProperty; }
private void CreateCharacter_Click(object sender, RoutedEventArgs e) { newCharacter.Name = BoxName.Text; newCharacter.Description = BoxDescription.Text; newCharacter.Gender = CustomEnum.GetValueFromDescription <Character.GenderType>(BoxGender.Text); newCharacter.Race = CustomEnum.GetValueFromDescription <Character.RaceType>(BoxRace.Text); chars.Add(newCharacter); DefaultCharacter_Click(this, new RoutedEventArgs()); UpdateGrids(); }
public void ReturnTrueAndMatchMessage_WhenArgumentIsMemberOfTheEnum() { // Arrange. CustomEnum value = CustomEnum.Value2; // Act. IValidationPredicateResult result = MemberOfEnumValidationPredicate <CustomEnum> .Instance.Match(value); // Assert. Assert.IsTrue(result.IsMatch); Assert.AreEqual("Argument value <Value2> is member of the enum <Bytes2you.Validation.UnitTests.Testing.Mocks.CustomEnum>.", result.Message); }
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { CustomEnum searchableEnum = (CustomEnum)attribute; lineNB = 0; if (searchableEnum.IsSearchable) { lineNB += 1; } return(EditorGUI.GetPropertyHeight(property) * lineNB); }
public void ReturnFalseAndUnmatchMessage_WhenArgumentIsNotMemberOfTheEnum() { // Arrange. CustomEnum value = (CustomEnum)5; // Act. IValidationPredicateResult result = MemberOfEnumValidationPredicate <CustomEnum> .Instance.Match(value); // Assert. Assert.IsFalse(result.IsMatch); Assert.AreEqual("Argument value <5> is not member of the enum <Bytes2you.Validation.UnitTests.Testing.Mocks.CustomEnum>.", result.Message); }
private void BindNode() { m_BindState = false; CBB_LeftParameterType.Items.Clear(); CBB_RightParameterType.Items.Clear(); CBB_RightParameter.Items.Clear(); CBB_CompareType.Items.Clear(); CustomEnum variableCustomEnum = MainForm.Instance.NodeTemplate.FindEnum("VariableType"); for (int i = 0; i < variableCustomEnum.Enums.Count; i++) { EnumItem enumItem = variableCustomEnum.Enums[i]; CBB_LeftParameterType.Items.Add(enumItem.EnumStr); CBB_RightParameterType.Items.Add(enumItem.EnumStr); } //绑定左边参数类型 FieldDesigner leftFieldDesigner = m_Node.FindFieldByName("LeftType"); EnumFieldDesigner leftEnumFieldDesigner = leftFieldDesigner.Field as EnumFieldDesigner; CBB_LeftParameterType.SelectedIndex = leftEnumFieldDesigner.ValueIndex; //绑定右边参数类型 FieldDesigner rightFieldDesigner = m_Node.FindFieldByName("RightType"); EnumFieldDesigner rightEnumFieldDesigner = rightFieldDesigner.Field as EnumFieldDesigner; CBB_RightParameterType.SelectedIndex = rightEnumFieldDesigner.ValueIndex; //绑定左边参数名 BindLeftParameter(leftEnumFieldDesigner.Value); //绑定右边参数 BindRightParameter(rightEnumFieldDesigner.Value); //绑定比较类型 CustomEnum compareCustomEnum = MainForm.Instance.NodeTemplate.FindEnum("CompareType"); for (int i = 0; i < compareCustomEnum.Enums.Count; i++) { EnumItem enumItem = compareCustomEnum.Enums[i]; CBB_CompareType.Items.Add(enumItem.EnumStr); } FieldDesigner compareTypeFieldDesigner = m_Node.FindFieldByName("CompareType"); EnumFieldDesigner compareEnumFieldDesigner = compareTypeFieldDesigner.Field as EnumFieldDesigner; CBB_CompareType.SelectedIndex = compareEnumFieldDesigner.ValueIndex; m_BindState = true; }
public Organ ConvertToScienceObject() { var Slot = CustomEnum.GetValueFromDescription <Character.BodyPartSlot.SlotType>(slot); return(new Organ(name, Slot, Character.BodyPartSlot.GetSlotPicture(Slot, CustomEnum.GetValueFromDescription <Character.RaceType>(race), genderInverted), description) { Id = id, Gender = genderInverted, Race = CustomEnum.GetValueFromDescription <Character.RaceType>(race) }); }
public void CustomEventInvokesSubscribedFunctionWithEnum() { ILogger logger = new Logger(); logger.OnCustom += (sender, args) => { Assert.Equal("B", args.EventType); Assert.Equal("Message", args.Message); }; CustomEnum e = CustomEnum.B; logger.Custom(e, "Message"); }
public static MvcHtmlString SmartDropdownListFor <TModel, TEnvironmentFor>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TEnvironmentFor> > expression, Expression <Func <TModel, string> > expressionName, string optionLabel, object htmlAttributes) where TEnvironmentFor : CustomEnum <TEnvironmentFor> { var modelName = ExpressionHelper.GetExpressionText(expressionName); var fullHtmlFieldName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(modelName); var selectList = CustomEnum <TEnvironmentFor> .GetAll().GetSelectList(); if (!string.IsNullOrEmpty(optionLabel) && selectList.Count != 0) { selectList[0].Text = optionLabel; } return(htmlHelper.DropDownList(fullHtmlFieldName, selectList, htmlAttributes)); }
private void CBB_CompareType_SelectedIndexChanged(object sender, EventArgs e) { if (!m_BindState) { return; } CustomEnum compareCustomEnum = MainForm.Instance.NodeTemplate.FindEnum("CompareType"); EnumItem enumItem = compareCustomEnum.FindEnum(CBB_CompareType.Text.Trim()); FieldDesigner compareFieldDesigner = m_Node.FindFieldByName("CompareType"); EnumFieldDesigner compareEnumFieldDesigner = compareFieldDesigner.Field as EnumFieldDesigner; compareEnumFieldDesigner.Value = enumItem.EnumStr; }
public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); m_complexTypeHkObjectPtr = des.ReadClassPointer <hkReferencedObject>(br); m_complexHiddenTypeCopyStart = br.ReadBoolean(); br.ReadUInt32(); br.ReadUInt16(); br.ReadByte(); m_complexTypeHkQuaternion = des.ReadQuaternion(br); m_complexTypeHkVector4 = des.ReadVector4(br); m_complexTypeEnumHkInt8 = (CustomEnum)br.ReadSByte(); br.ReadByte(); m_complexTypeEnumHkInt16 = (CustomEnum)br.ReadInt16(); m_complexTypeEnumHkInt32 = (CustomEnum)br.ReadInt32(); m_complexTypeEnumHkUint8 = (CustomEnum)br.ReadByte(); br.ReadByte(); m_complexTypeEnumHkUint16 = (CustomEnum)br.ReadUInt16(); m_complexTypeEnumHkUint32 = (CustomEnum)br.ReadUInt32(); m_complexTypeEnumHkInt8InvalidCheck = (CustomEnum)br.ReadSByte(); br.ReadByte(); m_complexTypeEnumHkInt16InvalidCheck = (CustomEnum)br.ReadInt16(); m_complexTypeEnumHkInt32InvalidCheck = (CustomEnum)br.ReadInt32(); m_complexTypeEnumHkUint8InvalidCheck = (CustomEnum)br.ReadByte(); br.ReadByte(); m_complexTypeEnumHkUint16InvalidCheck = (CustomEnum)br.ReadUInt16(); m_complexTypeEnumHkUint32InvalidCheck = (CustomEnum)br.ReadUInt32(); m_complexTypeFlagsHkInt8 = br.ReadSByte(); br.ReadByte(); m_complexTypeFlagsHkInt16 = br.ReadInt16(); m_complexTypeFlagsHkInt32 = br.ReadInt32(); m_complexTypeFlagsHkUint8 = br.ReadByte(); br.ReadByte(); m_complexTypeFlagsHkUint16 = br.ReadUInt16(); m_complexTypeFlagsHkUint32 = br.ReadUInt32(); m_complexTypeFlagsHkInt8InvalidCheck = br.ReadSByte(); br.ReadByte(); m_complexTypeFlagsHkInt16InvalidCheck = br.ReadInt16(); m_complexTypeFlagsHkInt32InvalidCheck = br.ReadInt32(); m_complexTypeFlagsHkUint8InvalidCheck = br.ReadByte(); br.ReadByte(); m_complexTypeFlagsHkUint16InvalidCheck = br.ReadUInt16(); m_complexTypeFlagsHkUint32InvalidCheck = br.ReadUInt32(); m_complexHiddenTypeCopyEnd = br.ReadBoolean(); br.ReadUInt64(); br.ReadUInt32(); br.ReadUInt16(); br.ReadByte(); }
public ModelAllPrivateSetNone DeepCloneWithCustomEnumProperty(CustomEnum customEnumProperty) { var result = new ModelAllPrivateSetNone( this.BoolProperty.DeepClone(), this.IntProperty.DeepClone(), this.StringProperty?.DeepClone(), this.GuidProperty.DeepClone(), this.DateTimeProperty.DeepClone(), customEnumProperty, this.CustomFlagsEnumProperty.DeepClone(), this.CustomClassProperty?.DeepClone(), this.CustomBaseClassProperty?.DeepClone(), this.CustomGenericClassOfCustomClassProperty?.DeepClone()); return(result); }
public static ICustomary GetCustom(CustomEnum customEnum) { switch (customEnum) { case CustomEnum.AFN: custom = new CustomAFN(); break; case CustomEnum.RTV: custom = new CustomRTV(); break; default: custom = new CustomDefault(); break; } return(custom); }
public ModelAllPublicSetNone DeepCloneWithCustomEnumProperty(CustomEnum customEnumProperty) { 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 = customEnumProperty, CustomFlagsEnumProperty = this.CustomFlagsEnumProperty.DeepClone(), CustomClassProperty = this.CustomClassProperty?.DeepClone(), CustomBaseClassProperty = this.CustomBaseClassProperty?.DeepClone(), CustomGenericClassOfCustomClassProperty = this.CustomGenericClassOfCustomClassProperty?.DeepClone(), }; return(result); }
public ModelPrivateSetGenericParentNonGenericChild( string parentStringProperty, int parentIntProperty, CustomEnum parentEnumProperty, CustomClass parentCustomClassProperty, CustomClass parentGenericArgumentProperty, CustomClass[] parentGenericArrayProperty, Guid?parentGenericNullableProperty, CustomGenericClass <Guid> parentGenericCustomGenericClassProperty, IReadOnlyCollection <CustomClass> parentGenericReadOnlyCollectionProperty, IReadOnlyList <CustomClass> parentGenericReadOnlyListProperty, IReadOnlyDictionary <CustomClass, Guid> parentGenericReadOnlyDictionaryProperty1, IReadOnlyDictionary <Guid, CustomClass> parentGenericReadOnlyDictionaryProperty2, IReadOnlyDictionary <string, Guid> parentGenericPartiallyClosedReadOnlyDictionaryProperty1, IReadOnlyDictionary <CustomClass, string> parentGenericPartiallyClosedReadOnlyDictionaryProperty2, string childStringProperty, int childIntProperty, CustomEnum childEnumProperty, CustomClass childCustomClassProperty, string[] childArrayProperty, decimal?childNullableProperty, CustomGenericClass <string> childCustomGenericClassProperty, IReadOnlyCollection <string> childReadOnlyCollectionProperty, IReadOnlyDictionary <string, string> childReadOnlyDictionaryProperty) : base(parentStringProperty, parentIntProperty, parentEnumProperty, parentCustomClassProperty, parentGenericArgumentProperty, parentGenericArrayProperty, parentGenericNullableProperty, parentGenericCustomGenericClassProperty, parentGenericReadOnlyCollectionProperty, parentGenericReadOnlyListProperty, parentGenericReadOnlyDictionaryProperty1, parentGenericReadOnlyDictionaryProperty2, parentGenericPartiallyClosedReadOnlyDictionaryProperty1, parentGenericPartiallyClosedReadOnlyDictionaryProperty2) { new { childStringProperty }.AsArg().Must().NotBeNullNorWhiteSpace(); new { childCustomClassProperty }.AsArg().Must().NotBeNull(); new { childArrayProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { childCustomGenericClassProperty }.AsArg().Must().NotBeNull(); new { childReadOnlyCollectionProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { childReadOnlyDictionaryProperty }.AsArg().Must().NotBeNullNorEmptyDictionaryNorContainAnyNullValues(); this.ChildStringProperty = childStringProperty; this.ChildIntProperty = childIntProperty; this.ChildEnumProperty = childEnumProperty; this.ChildCustomClassProperty = childCustomClassProperty; this.ChildArrayProperty = childArrayProperty; this.ChildNullableProperty = childNullableProperty; this.ChildCustomGenericClassProperty = childCustomGenericClassProperty; this.ChildReadOnlyCollectionProperty = childReadOnlyCollectionProperty; this.ChildReadOnlyDictionaryProperty = childReadOnlyDictionaryProperty; }
public ModelPrivateSetGeneric( string stringProperty, int intProperty, CustomEnum enumProperty, CustomClass customClassProperty, TFirst genericArgumentProperty, TFirst[] genericArrayProperty, TSecond?genericNullableProperty, CustomGenericClass <TSecond> genericCustomGenericClassProperty, IReadOnlyCollection <TFirst> genericReadOnlyCollectionProperty, IReadOnlyList <TFirst> genericReadOnlyListProperty, IReadOnlyDictionary <TFirst, TSecond> genericReadOnlyDictionaryProperty1, IReadOnlyDictionary <TSecond, TFirst> genericReadOnlyDictionaryProperty2, IReadOnlyDictionary <string, TSecond> genericPartiallyClosedReadOnlyDictionaryProperty1, IReadOnlyDictionary <TFirst, string> genericPartiallyClosedReadOnlyDictionaryProperty2) { new { stringProperty }.AsArg().Must().NotBeNullNorWhiteSpace(); new { customClassProperty }.AsArg().Must().NotBeNull(); new { genericArgumentProperty }.AsArg().Must().NotBeNull(); new { genericArrayProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { genericCustomGenericClassProperty }.AsArg().Must().NotBeNull(); new { genericReadOnlyCollectionProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { genericReadOnlyListProperty }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls(); new { genericReadOnlyDictionaryProperty1 }.AsArg().Must().NotBeNullNorEmptyDictionary(); new { genericReadOnlyDictionaryProperty2 }.AsArg().Must().NotBeNullNorEmptyDictionaryNorContainAnyNullValues(); new { genericPartiallyClosedReadOnlyDictionaryProperty1 }.AsArg().Must().NotBeNullNorEmptyDictionary(); new { genericPartiallyClosedReadOnlyDictionaryProperty2 }.AsArg().Must().NotBeNullNorEmptyDictionaryNorContainAnyNullValues(); this.StringProperty = stringProperty; this.IntProperty = intProperty; this.EnumProperty = enumProperty; this.CustomClassProperty = customClassProperty; this.GenericArgumentProperty = genericArgumentProperty; this.GenericArrayProperty = genericArrayProperty; this.GenericNullableProperty = genericNullableProperty; this.GenericCustomGenericClassProperty = genericCustomGenericClassProperty; this.GenericReadOnlyCollectionProperty = genericReadOnlyCollectionProperty; this.GenericReadOnlyListProperty = genericReadOnlyListProperty; this.GenericReadOnlyDictionaryProperty1 = genericReadOnlyDictionaryProperty1; this.GenericReadOnlyDictionaryProperty2 = genericReadOnlyDictionaryProperty2; this.GenericPartiallyClosedReadOnlyDictionaryProperty1 = genericPartiallyClosedReadOnlyDictionaryProperty1; this.GenericPartiallyClosedReadOnlyDictionaryProperty2 = genericPartiallyClosedReadOnlyDictionaryProperty2; }
public CustomEnum Enum(CustomEnum parameter = CustomEnum.Default) { return parameter; }
public static void OverloadedMethod2 (CustomEnum e) { Console.WriteLine("OverloadedMethod(<CustomEnum>)"); }