jeudi 4 août 2016

Why Mock object always null in unit test

My interface is like

public interface ISomeService
    {
        void DoStuff();
    }

Interface invoke in unit testing method like

    [TestInitialize]
    public void MessageHandlerTest_Initialize()
    {
        Mock<ISomeService> _mockSomeService = new Mock<ISomeService>();
        ISomeService view = _mockSomeService.Object;
    }

enter image description here Why view is always null?

Aucun commentaire:

Enregistrer un commentaire