public static void ShouldProvideFormattedDescriptionOfIndependentRuleDto()
        {
            //GIVEN
            var dto = Any.Instance <NoUsingsRuleComplementDto>();

            //WHEN
            var text = HasNoUsingsRuleMetadata.Format(dto);

            //THEN
            text.Should().Be(new RuleDescription(
                                 $"{dto.ProjectAssemblyNamePattern.Text()} {HasNoUsingsRuleMetadata.HasNoUsings} from {dto.FromPattern.Text()} to {dto.ToPattern.Text()}"));
        }
Esempio n. 2
0
        public void ShouldReturnDescriptionBasedOnDto()
        {
            //GIVEN
            var dto  = Any.Instance <NoUsingsRuleComplementDto>();
            var rule = new NoUsingsRule(dto, Any.Instance <INamespaceBasedRuleViolationFactory>());

            //WHEN
            var description = rule.Description();

            //THEN
            description.Should().Be(HasNoUsingsRuleMetadata.Format(dto));
        }
 public void Log(NoUsingsRuleComplementDto dto)
 {
     _writeLine($"{DiscoveredRule}{HasNoUsingsRuleMetadata.Format(dto)}");
 }
Esempio n. 4
0
 public RuleDescription Description()
 {
     return(HasNoUsingsRuleMetadata.Format(_dto));
 }
 public void Log(NoUsingsRuleComplementDto dto)
 {
     Log(HasNoUsingsRuleMetadata.Format(dto));
 }