I am new to mocking and i just started to use moq. The tool states that we can use moq for mocking classes without interfaces
. I was wondering if it is posible when mocking to keep the internal state of the class. For example:
//define class for mocking
var mock = new Mock<ILoveThisFramework>();
//define
mock.Setup(framework => framework.DownloadExists("2.0.0.0"))
.Returns(true)
.AtMostOnce();
//use mocking tools to call methods and return defined results
The question: althought the results were defined, have the internal state (e.g. private class variables) changed? (keep the class state?)