chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Try the following production code:

    public class Log4NetTest
    {

        public void TestRun()
        {
            log4net.Config.XmlConfigurator.Configure();
            var log = LogManager.GetLogger(typeof(Log4NetTest));
            log.Error("Worse");
            log.Info("Dont Kid");
        }
    }

    public class Log4NetTypeMock
    {
        public static readonly ILog log
            = LogManager.GetLogger(typeof(Log4NetTypeMock))
            ;

        public static readonly Log4NetTest log4Net;
    }


And the test3:
      [Test, Isolated]
        public void Test1()
        {
            Isolate.WhenCalled(() => Log4NetTypeMock.log)
            .ReturnRecursiveFake();
            Assert.AreEqual(2, 1 + 1);
        }
        [Test, Isolated]
        public void Test3()
        {
            Isolate.WhenCalled(() => Log4NetTypeMock.log4Net)
.ReturnRecursiveFake();

            Isolate.WhenCalled(() => Log4NetTypeMock.log)
.ReturnRecursiveFake();
            Assert.AreEqual(2, 1 + 1);
        }


Test1() passes, but Test3() fails. This is also a bug.
________
PORNSTARS SOLEIL
asked by nsoonhui (59.1k points)

1 Answer

0 votes
Hi Soon Hui,

Thank you for the great issue report. I need to further investigate it - let's take it offline.
answered by dhelper (11.9k points)
...