public void HandlesInlineAdditionSuccessful_InsertInterfaceAfterOtherInterface() { var addition = "IService"; var contextStart = "public class Test : IOtherService"; var contextEnd = string.Empty; var styleProvider = new CSharpStyleProvider(); var output = styleProvider.AdaptInlineAddition(addition, contextStart, contextEnd); Assert.Equal(", IService", output); }
public void HandlesAdditionSuccessful_InsertAfterClosingBrace() { var insertionBuffer = new List <string>() { "FunctionA();", }; var lastContextLine = "}"; var nextContextLine = string.Empty; var styleProvider = new CSharpStyleProvider(); var output = styleProvider.AdaptInsertionBlock(insertionBuffer, lastContextLine, nextContextLine); Assert.Equal(string.Empty, output.First()); }
public void HandlesAdditionSuccessful_InsertElseBlock() { var insertionBuffer = new List <string>() { "else", "{", " // Else do this", "}", }; var lastContextLine = "}"; var nextContextLine = string.Empty; var styleProvider = new CSharpStyleProvider(); var output = styleProvider.AdaptInsertionBlock(insertionBuffer, lastContextLine, nextContextLine); Assert.Equal("else", output.First()); }
public void HandlesAdditionSuccessful_InsertBlock() { var insertionBuffer = new List <string>() { "if (true)", "{", " FunctionA();", "}", }; var lastContextLine = string.Empty; var nextContextLine = "FunctionB();"; var styleProvider = new CSharpStyleProvider(); var output = styleProvider.AdaptInsertionBlock(insertionBuffer, lastContextLine, nextContextLine); Assert.Equal(string.Empty, output.Last()); }