예제 #1
0
        public void StaticFieldAccessIsFaked()
        {
            Replace.CallsTo(() => StaticClass.StaticField).With(() => 99);

            var code = new CodeUnderTest();
            var result = code.CallsStaticField();

            Assert.AreEqual(99, result);
        }
예제 #2
0
        public void OriginalStaticFieldAccessSucceeds()
        {
            StaticClass.StaticField = 1234;

            Replace.CallsTo(() => StaticClass.StaticField).CallOriginal();

            var code = new CodeUnderTest();
            var result = code.CallsStaticField();

            Assert.AreEqual(1234, result);
        }