private void SetEdgeCaseHint() { var edgeCaseHintAttribute = KataAnnotations.OfType <EdgeCaseHintAttribute>().FirstOrDefault(); if (edgeCaseHintAttribute != null) { EdgeCaseHint = edgeCaseHintAttribute.EdgeCaseHint; } }
private void SetStepShouldDo() { var stepShouldDoAttribute = KataAnnotations.OfType <StepShouldDoAttribute>().FirstOrDefault(); if (stepShouldDoAttribute != null) { StepShouldDo = stepShouldDoAttribute.ShouldDoText; } }
public TestMethod(MethodInfo methodInfo) { if (methodInfo == null) { throw new ArgumentNullException("methodInfo"); } Method = methodInfo; KataAnnotations = methodInfo.GetCustomAttributes().OfType <IKataAnnotation>().ToList(); var testStepAttrib = KataAnnotations.OfType <TestStepAttribute>().FirstOrDefault(); if (testStepAttrib != null) { Level = testStepAttrib.StepNumber; } SetEdgeCaseHint(); HasTestCaseAttribute = methodInfo.GetCustomAttributes().OfType <TestCaseAttribute>().ToList().Any(); HasExpectedExceptionAttribute = methodInfo.GetCustomAttributes().OfType <ExpectedException>().ToList().Any(); HasDoNotShowImplementedTooMuchMessageAttribute = methodInfo.GetCustomAttributes().OfType <DoNotShowImplementedTooMuchMessage>().ToList().Any(); SetStepShouldDo(); }