????protected??????????????????η????????????????????????????????????????????????仰???????ù????У?protected?????????????(???????????????????????ó??)?????????(????????????????г???????????)???????????????????protected??????????ε?????????“????”??ζ???????????????е?????????“???”???譚?????????????????漰protected?????
????????protected????
??????????????????а??????protected??????????
????public class SomeClass   {       protected int SomeMethod(string arg) { ... }   }
???????????????????protected???????е????????????????????????????????????
????public class SomeClassForTest : SomeClass   {       public int PublicSomeMethod(string arg)       {           return this.SomeMethod(arg);       }   }
?????????????????У?????????????PublicSomeMethod??????????SomeMethod??????
????var testClass = new SomeClassForTest();   var result = testClass.PublicSomeMethod(null);   Assert.Equal(0?? result);
???????????
??????????????鷳????????SomeClass???е?SomeMethod???????protected internal?????????????InternalVisibleTo?????????????????????????????????????????????????????????????????
??????protected????????Mock
????????????????????????protected??????
????public class SomeClass   {       protected virtual int SomeMethod(string arg) { ... }   }
??????????????????????????SomeClass????????????????????????????????SomeMethod??????????SomeMethod????????????????????????????????????????SomeMethod????Mock??Stub???????????????????????????????
????public class MockSomeClass : SomeClass   {       protected override int SomeMethod(string arg)       {           return this.PublicSomeMethod(arg);       }       public virtual int PublicSomeMethod(string arg)       {           return base.SomeMethod(arg);       }   }
??????MockSomeClass?У??????????????SomeMethod??????????????????й?????PublicSomeMethod????????PublicSomeMethod??????????????SomeMethod???????????????????????κδ???????MockSomeClass????SomeMethod????????????????????SomeMethod????Mock??Stub???????????PublicSomeMethod?????
????Mock<MockSomeClass> mockSomeClass = new Mock<MockSomeClass>() { CallBase = true };   mockSomeClass.Setup(c => c.PublicSomeMethod("123")).Returns(123);   DoSomeTest(mockSomeClass.Object); // use the mock object 
????????????
?????????????
?????????????????“???????”??????????е?protected??????????virtual????????????????????н???override??????Mock??????????????????????virtual???????????public??????????????????????????????????????ò??????????仰???????????????????override??protected??????????????????????????????????????????????????????????????????????????????????????ò?……???????????????