public void HasReturnTypeOfTest() { var cm = new CodeMemberMethod(); Assert.IsFalse(cm.HasReturnTypeOf(typeof(bool)).Compile().Invoke()); cm.WithReturnType<InfoApe>(); Assert.IsFalse(cm.HasReturnTypeOf(typeof(uint)).Compile().Invoke()); Assert.IsTrue(cm.HasReturnTypeOf(typeof(InfoApe)).Compile().Invoke()); }
public void HasReturnTypeTest() { var cm = new CodeMemberMethod(); Assert.IsFalse(cm.HasReturnType<string>().Compile().Invoke()); cm.WithReturnType<int>(); Assert.IsFalse(cm.HasReturnType<string>().Compile().Invoke()); Assert.IsTrue(cm.HasReturnType<int>().Compile().Invoke()); }
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()); }