/// <summary> /// Appends a 'Assert.Inconclusive("Text")' statement to the specified method. /// </summary> /// <param name="codeMemberMethod">The code member method.</param> /// <param name="inconclusiveText">The warning parameter text of the Assert.Inconclusive call.</param> public static void AppendAssertInconclusive(CodeMemberMethod codeMemberMethod, string inconclusiveText) { // add a blank line and Assert.Inconclusive(" specified text ..."); to the method body. codeMemberMethod .AddBlankLine() .StaticClass("Assert").Invoke("Inconclusive").With(inconclusiveText).Commit(); }
public void ContainsStatementTest() { var cm = new CodeMemberMethod(); cm.AddBlankLine(); Assert.IsFalse(cm.ContainsStatement(typeof(bool)).Compile().Invoke()); cm.WithReturnType<InfoApe>(); Assert.IsFalse(cm.ContainsStatement(typeof(uint)).Compile().Invoke()); Assert.IsTrue(cm.ContainsStatement(typeof(CodeSnippetStatement)).Compile().Invoke()); Assert.IsFalse(cm.ContainsStatement<CodeStatement>().Compile().Invoke()); Assert.IsTrue(cm.ContainsStatement<CodeSnippetStatement>().Compile().Invoke()); }