Пример #1
0
        private void SetEdgeCaseHint()
        {
            var edgeCaseHintAttribute = KataAnnotations.OfType <EdgeCaseHintAttribute>().FirstOrDefault();

            if (edgeCaseHintAttribute != null)
            {
                EdgeCaseHint = edgeCaseHintAttribute.EdgeCaseHint;
            }
        }
Пример #2
0
        private void SetStepShouldDo()
        {
            var stepShouldDoAttribute = KataAnnotations.OfType <StepShouldDoAttribute>().FirstOrDefault();

            if (stepShouldDoAttribute != null)
            {
                StepShouldDo = stepShouldDoAttribute.ShouldDoText;
            }
        }
Пример #3
0
        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();
        }