Public class Baseclass{
protected void Setting (int y) {
y=10;
}
}
public class ChildClass :Baseclass{
public void setvalue (int x){
Setting(x);
}
}
How we mock Setting method of Base Class ??
Mock.NonPublic.Arrange(new Baseclass() , "Setting", ArgExpr.IsAny<int>()).DoNothing(); // Mock.NonPublic not working for Protected methods
protected void Setting (int y) {
y=10;
}
}
public class ChildClass :Baseclass{
public void setvalue (int x){
Setting(x);
}
}
How we mock Setting method of Base Class ??
Mock.NonPublic.Arrange(new Baseclass() , "Setting", ArgExpr.IsAny<int>()).DoNothing(); // Mock.NonPublic not working for Protected methods