예제 #1
0
        public void WhenYouAddToStaticInt_AllReferencesEffected()
        {
            var intHolder = new StaticVsNonStatic();

            StaticVsNonStatic.StaticIndex++;

            Assert.Equal(1, intHolder.GetStaticIndex());
        }
예제 #2
0
        public void WhenYouAddToNonStaticInt_OnlyEffectsThatInstance()
        {
            var intHolder1 = new StaticVsNonStatic();
            var intHolder2 = new StaticVsNonStatic();

            intHolder1.NonStaticIndex++;

            Assert.NotEqual(intHolder1.NonStaticIndex, intHolder2.NonStaticIndex);
        }