Exemple #1
0
        public void DefaultValues_ReferenceType_DefaultValueViaCallback()
        {
            var obj = new ObjectWithDefaultValues();

            Assert.AreNotEqual(null, obj.ReferenceType_DefaultValueViaCallback);
            Assert.IsInstanceOfType(obj.ReferenceType_DefaultValueViaCallback, typeof(Collection <int>));
        }
Exemple #2
0
        public void DefaultValues_ReferenceType_DefaultValueViaValue_DifferentInstanceForAllClasses()
        {
            var obj1 = new ObjectWithDefaultValues();
            var obj2 = new ObjectWithDefaultValues();

            Assert.IsFalse(ReferenceEquals(obj1.ReferenceType_DefaultValueViaCallback, obj2.ReferenceType_DefaultValueViaCallback));
        }
Exemple #3
0
        public void DefaultValues_ReferenceType_DefaultValueViaValue_SameInstanceForAllClasses()
        {
            var obj1 = new ObjectWithDefaultValues();
            var obj2 = new ObjectWithDefaultValues();

            Assert.IsTrue(ReferenceEquals(obj1.ReferenceType_DefaultValueViaValue, obj2.ReferenceType_DefaultValueViaValue));
        }
Exemple #4
0
        public void DefaultValues_ReferenceType_DefaultValueViaValue()
        {
            var obj = new ObjectWithDefaultValues();

            Assert.AreNotEqual(null, obj.ReferenceType_DefaultValueViaValue);
            Assert.IsInstanceOf(typeof(Collection <int>), obj.ReferenceType_DefaultValueViaValue);
        }
Exemple #5
0
        public void DefaultValues_ReferenceType_NoDefaultValue()
        {
            var obj = new ObjectWithDefaultValues();

            Assert.AreEqual(null, obj.ReferenceType_NoDefaultValue);
        }
Exemple #6
0
        public void DefaultValues_ValueType_DefaultValueViaCallback()
        {
            var obj = new ObjectWithDefaultValues();

            Assert.AreEqual(10, obj.ValueType_DefaultValueViaCallback);
        }
Exemple #7
0
        public void DefaultValues_ValueType_DefaultValueViaValue()
        {
            var obj = new ObjectWithDefaultValues();

            Assert.AreEqual(5, obj.ValueType_DefaultValueViaValue);
        }