I am writing unit tests using moq framework. I am calling one method in base controller setsession()
which will set session using SetString("userdata",object)
and I have one more method getsession()
which will get session.
var sessionMock = new Mock<ISession>();
sessionMock.Setup(s => s.GetString("userdata")).Returns(Object);--failing
sessionMock.Setup(s => s.SetString("userdata",object));--failing
I am getting the error in s.GetString
and s.SetString
.
As GetString
and SetString
are extension methods may be I need to use another way to handle it.
Can you please help me?
See Question&Answers more detail:os