public void Should_not_offer_already_overridden_method()
        {
            var buffer   = @"
public class WeirdString : String
{
    public override string ToString()
    {
        return ""weird"";
    }
$
}";
            var location = TestHelpers.GetLineAndColumnFromDollar(buffer);
            var request  = new Request {
                Buffer = buffer, FileName = "myfile.cs", Line = location.Line, Column = location.Column
            };
            var solution = new FakeSolutionBuilder().AddFile(buffer, "myfile.cs").Build();
            var parser   = new BufferParser(solution);

            var context   = new OverrideContext(request, parser);
            var overrides = context.OverrideTargets.Select(m => m.OverrideTargetName).ToArray();

            overrides.ShouldNotContain("public virtual string ToString ();");
        }
Exemple #2
0
 /// <inheritdoc />
 public TypeDeclarationSyntax Type(OverrideContext ctx)
 {
     var canUseCorrectCallConv = ctx.IsNet5OrGreater;