public void UpdateDirectivesTest(string replace, string expected) { var updater = new SourceCodeUpdater(CSharpSyntaxTree.ParseText(Input.Replace("using System.ServiceModel.Security;", replace)), Template, _logger); var result = updater.UpdateDirectives().ToFullString().Replace(" ", string.Empty); var outdated = "using System.ServiceModel;using System.ServiceModel.Security;"; Assert.DoesNotContain(outdated, result); Assert.Contains(expected.Replace(" ", string.Empty), result); }
public void RelpaceNamesTest() { var updater = new SourceCodeUpdater(CSharpSyntaxTree.ParseText(Input), Template, _logger); var result = updater.UpdateDirectives().ToFullString().Replace(" ", string.Empty); Assert.Contains("host", result); Assert.Contains("SampleService", result); Assert.DoesNotContain("varName", result); Assert.DoesNotContain("ServiceType", result); }