자동 생성 클래스를 ExcludeFromCodeCoverage로 표시 할 수 있습니까? 나는 다른 영역에서 그 속성을 사용하고 있으며 훌륭하게 작동합니다. 그러나 자동 생성 된 사람의 코드를 열고 클래스를 ExcludeFromCodeCoverage로 표시하면 해당 클래스를 다시 생성하면 완전히 덮어 쓰게됩니다.ExcludeFromCodeCoverage 자동 생성 코드 제외
dbml의 코드 뒤에 부분 클래스를 만들고이 속성을 적용 할 수 있지만 많은 부분 클래스를 만들 수 있습니다.
[Serializable]
[AttributeUsage(AttributeTargets.Assembly)]
[MulticastAttributeUsage(MulticastTargets.Class | MulticastTargets.Struct)]
[ProvideAspectRole(StandardRoles.PerformanceInstrumentation)]
public sealed class DisableCoverageAttribute : TypeLevelAspect, IAspectProvider
{
public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
{
Type disabledType = (Type)targetElement;
var introducedExclusion = new CustomAttributeIntroductionAspect(
new ObjectConstruction(typeof (ExcludeFromCodeCoverageAttribute)));
return new[] {new AspectInstance(disabledType, introducedExclusion)};
}
}
가 그럼 그냥 조립이 측면을 적용하고 제외 할 네임 스페이스를 제공
자동 생성 클래스를 '부분적'으로 만들 수 있습니까 (어떤 방식 으로든 생성기를 변경)? –