Пример #1
0
        public void should_initialize_to_default_value()
        {
            DefaultValueDemoClass defaultValueDemo = new DefaultValueDemoClass();

            // change the variable values of the following 2 lines to correct values ????
            var       expectedReferenceTypeValue = default(RefTypeClass);
            const int expectedValueTypeValue     = 0;

            Assert.Equal(expectedReferenceTypeValue, defaultValueDemo.referenceTypeValue);
            Assert.Equal(expectedValueTypeValue, defaultValueDemo.valueTypeValue);
        }
Пример #2
0
        public void should_initialize_to_default_value()
        {
            var defaultValueDemo = new DefaultValueDemoClass();

            // change the variable values of the following 2 lines to correct values
            //var expectedReferenceTypeValue = new RefTypeClass(default(int));
            //const int expectedValueTypeValue = 1;
            var expectedReferenceTypeValue = new RefTypeClass(0);

            expectedReferenceTypeValue = null;
            const int expectedValueTypeValue = 0;

            Assert.Equal(expectedReferenceTypeValue, defaultValueDemo.referenceTypeValue);
            Assert.Equal(expectedValueTypeValue, defaultValueDemo.valueTypeValue);
        }