Gostaria de descobrir se há fragmentos de texto "duplicados" entre duas linhas específicas.
Por exemplo, eu gostaria de descobrir que no primeiro "TestMethod" há o dobro do conjunto "TC.Requirement".
[TestMethod()]
[TestProperty(TC.Name, "")]
[Description("A test for ")]
[TestProperty(TC.InternalTcId, "2c80e355-c156-4fd1-ba10-bdfb50f67828")]
[Owner("")]
[TestProperty(TC.CreationDate, "")]
[TestProperty(TC.Requirement, "1111")]
[TestProperty(TC.PostCondition, "")]
[TestProperty(TC.PreCondition, "")]
[TestProperty(TC.Types, TCType.Normal_Case)]
[TestProperty(TC.Requirement, "2222")]
[TestProperty(TC.ReviewDate, "")]
public void ATest()
{
Assert.IsNotNull(target);
}
[TestMethod()]
[TestProperty(TC.Name, "")]
[Description("A test for ")]
[TestProperty(TC.InternalTcId, "8d00d256-86fe-4a08-864c-6f1bf38581ce")]
[Owner("")]
[TestProperty(TC.CreationDate, "")]
[TestProperty(TC.PostCondition, "")]
[TestProperty(TC.PreCondition, "")]
[TestProperty(TC.Types, TCType.Normal_Case)]
[TestProperty(TC.Requirement, "3333")]
[TestProperty(TC.ReviewDate, "")]
public void BTest()
{
Assert.IsNotNull(target);
}
No primeiro TestMethod há um atributo duplicado de atributo, no segundo TestMethod não há um segundo.
Você poderia me ajudar a descobrir o regex dessa busca?
Obrigado: -)