public void DefaultValues_ReferenceType_DefaultValueViaValue_DifferentInstanceForAllClasses() { var obj1 = new ObjectWithDefaultValues(); var obj2 = new ObjectWithDefaultValues(); Assert.IsFalse(ReferenceEquals(obj1.ReferenceType_DefaultValueViaCallback, obj2.ReferenceType_DefaultValueViaCallback)); }
public void DefaultValues_ReferenceType_DefaultValueViaValue_SameInstanceForAllClasses() { var obj1 = new ObjectWithDefaultValues(); var obj2 = new ObjectWithDefaultValues(); Assert.IsTrue(ReferenceEquals(obj1.ReferenceType_DefaultValueViaValue, obj2.ReferenceType_DefaultValueViaValue)); }
public void DefaultValues_ReferenceType_DefaultValueViaCallback() { var obj = new ObjectWithDefaultValues(); Assert.AreNotEqual(null, obj.ReferenceType_DefaultValueViaCallback); Assert.IsInstanceOf(typeof(Collection<int>), obj.ReferenceType_DefaultValueViaCallback); }
public void DefaultValues_ReferenceType_NoDefaultValue() { var obj = new ObjectWithDefaultValues(); Assert.AreEqual(null, obj.ReferenceType_NoDefaultValue); }
public void DefaultValues_ValueType_DefaultValueViaCallback() { var obj = new ObjectWithDefaultValues(); Assert.AreEqual(10, obj.ValueType_DefaultValueViaCallback); }
public void DefaultValues_ValueType_DefaultValueViaValue() { var obj = new ObjectWithDefaultValues(); Assert.AreEqual(5, obj.ValueType_DefaultValueViaValue); }
public void DefaultValues_ReferenceType_DefaultValueViaValue() { var obj = new ObjectWithDefaultValues(); Assert.AreNotEqual(null, obj.ReferenceType_DefaultValueViaValue); Assert.IsInstanceOfType(obj.ReferenceType_DefaultValueViaValue, typeof(Collection<int>)); }
public static void SetDefaultValues(object obj) { ObjectWithDefaultValues.SetDefaults(obj); }