c# - Mocking the class under test with private method calls ...
codereview.stackexchange.com › questions › 11995Mocking the class under test with private method calls. Consider the scenario below. It covers multiple methods of my unit under test. public class OriginalSample { public bool Foo (ISomeEntity entity) { return entity.IsThatSo ? entity.IsThatSo : Bar (entity); } public bool Bar (ISomeEntity entity) { return entity.IsThatAsWell; } } [TestClass] public class OriginalSampleTest { [TestMethod] public void Foo_EntityWithSo_ReturnsTrue { // Arrange Mock<ISomeEntity> someEntityMock = ...