-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationstate: releasedThe issue is releasedThe issue is released
Description
Description
Mockolate supports setting up and verifying protected members, but this is completely undocumented.
Missing Documentation
SetupMock.Protected.Method()and.Property()VerifyMock.Protected.Invoked(),.Got(),.Set()- Examples of working with protected methods and properties
Suggested Documentation
Add a new section titled "Working with Protected Members":
### Working with Protected Members
Mockolate allows you to setup and verify protected methods and properties:
```csharp
var sut = Mock.Create<MyChocolateDispenser>();
// Setup protected method
sut.SetupMock.Protected.Method(\"DispenseInternal\",
It.Is(\"Dark\"), It.IsAny<int>())
.Returns(true);
// Setup protected property
sut.SetupMock.Protected.Property(\"InternalStock\").InitializeWith(100);
// Verify protected method was called
sut.VerifyMock.Protected.Invoked(\"DispenseInternal\",
It.Is(\"Dark\"), It.IsAny<int>()).Once();
// Verify protected property was accessed
sut.VerifyMock.Protected.Got(\"InternalStock\").AtLeastOnce();Reactions are currently unavailable
Metadata
Metadata
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationstate: releasedThe issue is releasedThe issue is released