/// <summary> /// /// </summary> /// <param name="member"> /// /// </param> /// <returns> /// /// </returns> public override ProblemCollection Check(Member member) { var methodCandidate = member as Method; // Only check methods that have a test attribute. if ((methodCandidate != null) && DoesMethodHaveAnAttribute(methodCandidate, DeveloperTestConstants.TestAttributeName)) { // Get the setup instructions only once for this Check invocation, and use it // for all resolutions. IList<CustomInstruction> setupMethodInstructions = GetListOfCustomInstructionForMethodByUniqueAttributeNameAndClassType(member.DeclaringType, DeveloperTestConstants.SetupMethodAttributeName); var helper = new Helpers.DoNotConfuseRhinoMocksStubsWithMocks(); ProcessFoundProblems(helper.CheckIfRhinoMocksVerifyAllExpectationsIsInvokedOnAFieldThatIsAStub( methodCandidate.Name.Name, setupMethodInstructions, GetCustomInstructionListFromInstructionCollection(methodCandidate.Instructions))); ProcessFoundProblems(helper.CheckIfRhinoMocksVerifyAllExpectationsIsInvokedOnALocalThatIsAStub( methodCandidate.Name.Name, setupMethodInstructions, GetCustomInstructionListFromInstructionCollection(methodCandidate.Instructions))); } return Problems; }
/// <summary> /// /// </summary> /// <param name="member"> /// /// </param> /// <returns> /// /// </returns> public override ProblemCollection Check(Member member) { var methodCandidate = member as Method; // Only check methods that have a test attribute. if ((methodCandidate != null) && DoesMethodHaveAnAttribute(methodCandidate, DeveloperTestConstants.TestAttributeName)) { // Get the setup instructions only once for this Check invocation, and use it // for all resolutions. IList <CustomInstruction> setupMethodInstructions = GetListOfCustomInstructionForMethodByUniqueAttributeNameAndClassType(member.DeclaringType, DeveloperTestConstants.SetupMethodAttributeName); var helper = new Helpers.DoNotConfuseRhinoMocksStubsWithMocks(); ProcessFoundProblems(helper.CheckIfRhinoMocksVerifyAllExpectationsIsInvokedOnAFieldThatIsAStub( methodCandidate.Name.Name, setupMethodInstructions, GetCustomInstructionListFromInstructionCollection(methodCandidate.Instructions))); ProcessFoundProblems(helper.CheckIfRhinoMocksVerifyAllExpectationsIsInvokedOnALocalThatIsAStub( methodCandidate.Name.Name, setupMethodInstructions, GetCustomInstructionListFromInstructionCollection(methodCandidate.Instructions))); } return(Problems); }