/// <inheritdoc /> public TestStepData Normalize() { string normalizedId = ModelNormalizationUtils.NormalizeTestComponentId(Id); string normalizedName = ModelNormalizationUtils.NormalizeTestComponentName(Name); string normalizedFullName = ModelNormalizationUtils.NormalizeTestComponentName(fullName); string normalizedParentId = ModelNormalizationUtils.NormalizeTestComponentId(parentId); string normalizedTestId = ModelNormalizationUtils.NormalizeTestComponentId(testId); CodeLocation normalizedCodeLocation = CodeLocation.Normalize(); CodeReference normalizedCodeReference = CodeReference.Normalize(); PropertyBag normalizedMetadata = ModelNormalizationUtils.NormalizeMetadata(Metadata); if (ReferenceEquals(Id, normalizedId) && ReferenceEquals(Name, normalizedName) && ReferenceEquals(fullName, normalizedFullName) && ReferenceEquals(parentId, normalizedParentId) && ReferenceEquals(testId, normalizedTestId) && CodeLocation == normalizedCodeLocation && CodeReference == normalizedCodeReference && ReferenceEquals(Metadata, normalizedMetadata)) { return(this); } return(new TestStepData(normalizedId, normalizedName, normalizedFullName, normalizedTestId) { parentId = normalizedParentId, CodeElement = CodeElement, CodeLocation = normalizedCodeLocation, CodeReference = normalizedCodeReference, Metadata = normalizedMetadata, isPrimary = isPrimary, isTestCase = isTestCase, isDynamic = isDynamic }); }
/// <inheritdoc /> public TestParameterData Normalize() { string normalizedId = ModelNormalizationUtils.NormalizeTestComponentId(Id); string normalizedName = ModelNormalizationUtils.NormalizeTestComponentName(Name); CodeLocation normalizedCodeLocation = CodeLocation.Normalize(); CodeReference normalizedCodeReference = CodeReference.Normalize(); PropertyBag normalizedMetadata = ModelNormalizationUtils.NormalizeMetadata(Metadata); if (ReferenceEquals(Id, normalizedId) && ReferenceEquals(Name, normalizedName) && CodeLocation == normalizedCodeLocation && CodeReference == normalizedCodeReference && ReferenceEquals(Metadata, normalizedMetadata)) { return(this); } return(new TestParameterData(normalizedId, normalizedName) { CodeElement = CodeElement, CodeLocation = normalizedCodeLocation, CodeReference = normalizedCodeReference, Metadata = normalizedMetadata }); }
/// <inheritdoc /> public TestData Normalize() { string normalizedId = ModelNormalizationUtils.NormalizeTestComponentId(Id); string normalizedName = ModelNormalizationUtils.NormalizeTestComponentName(Name); string normalizedFullName = ModelNormalizationUtils.NormalizeTestComponentName(fullName); CodeLocation normalizedCodeLocation = CodeLocation.Normalize(); CodeReference normalizedCodeReference = CodeReference.Normalize(); PropertyBag normalizedMetadata = ModelNormalizationUtils.NormalizeMetadata(Metadata); List <TestData> normalizedChildren = NormalizationUtils.NormalizeCollection <List <TestData>, TestData>( children, () => new List <TestData>(), child => child.Normalize(), ReferenceEquals); List <TestParameterData> normalizedParameters = NormalizationUtils.NormalizeCollection <List <TestParameterData>, TestParameterData>( parameters, () => new List <TestParameterData>(), parameter => parameter.Normalize(), ReferenceEquals); if (ReferenceEquals(Id, normalizedId) && ReferenceEquals(Name, normalizedName) && ReferenceEquals(fullName, normalizedFullName) && CodeLocation == normalizedCodeLocation && CodeReference == normalizedCodeReference && ReferenceEquals(Metadata, normalizedMetadata) && ReferenceEquals(children, normalizedChildren) && ReferenceEquals(parameters, normalizedParameters)) { return(this); } return(new TestData(normalizedId, normalizedName, normalizedFullName, normalizedChildren, normalizedParameters) { CodeElement = CodeElement, CodeLocation = normalizedCodeLocation, CodeReference = normalizedCodeReference, Metadata = normalizedMetadata, isTestCase = isTestCase }); }
/// <inheritdoc /> public AnnotationData Normalize() { CodeLocation normalizedCodeLocation = codeLocation.Normalize(); CodeReference normalizedCodeReference = codeReference.Normalize(); string normalizedMessage = ModelNormalizationUtils.NormalizeAnnotationText(message); string normalizedDetails = ModelNormalizationUtils.NormalizeAnnotationText(details); if (codeLocation == normalizedCodeLocation && codeReference == normalizedCodeReference && ReferenceEquals(message, normalizedMessage) && ReferenceEquals(details, normalizedDetails)) { return(this); } return(new AnnotationData(type, normalizedCodeLocation, normalizedCodeReference, normalizedMessage, normalizedDetails) { codeElement = codeElement }); }