예제 #1
0
        private void BindTo([NotNull] TestDescriptor testDescriptor)
        {
            _textBoxName.Text           = testDescriptor.Name;
            _textBoxImplementation.Text = GetImplementation(testDescriptor);

            var testImplementationInfo =
                TestImplementationUtils.GetTestImplementationInfo(testDescriptor);

            _textBoxTestDescription.Text = testImplementationInfo == null
                                                               ? string.Empty
                                                               : testImplementationInfo.GetTestDescription();

            _textBoxCategories.Text = testImplementationInfo == null
                                                          ? string.Empty
                                                          : StringUtils.ConcatenateSorted(
                testImplementationInfo.TestCategories,
                ", ");
            try
            {
                _textBoxSignature.Text = testImplementationInfo == null
                                                                 ? "Unable to create test signature"
                                                                 : TestImplementationUtils.GetTestSignature(
                    testImplementationInfo);
            }
            catch (Exception e)
            {
                _textBoxSignature.Text = string.Format("Unable to get test signature ({0})",
                                                       e.Message);
            }
        }
예제 #2
0
        private static string GetDescription([NotNull] QualityCondition condition)
        {
            string description;

            if (string.IsNullOrEmpty(condition.Description))
            {
                TestDescriptor testDescriptor = condition.TestDescriptor;

                ITestImplementationInfo testImplementationInfo =
                    testDescriptor == null
                                                ? null
                                                : TestImplementationUtils.GetTestImplementationInfo(testDescriptor);

                description = testImplementationInfo == null
                                                      ? string.Empty
                                                      : testImplementationInfo.GetTestDescription();
            }
            else
            {
                description = condition.Description;
            }

            if (description == null)
            {
                return(string.Empty);
            }

            description = description.Replace("\r", string.Empty);
            description = description.Replace("\n", Environment.NewLine);

            return(description);
        }
예제 #3
0
        private string GetParameterDescription([CanBeNull] string parameterName)
        {
            if (parameterName == null || _testDescriptor == null)
            {
                return(null);
            }

            var testFactory = TestImplementationUtils.GetTestImplementationInfo(_testDescriptor);

            return(testFactory?.Parameters
                   .FirstOrDefault(x => x.Name == parameterName)
                   ?.Description);
        }