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 CreateTestStubForMethodTest() { var method = new CodeMemberMethod(); method.Name = "TheMethodName"; CodeMethodComposer.CreateTestStubForMethod(method); var expectedComment = "TODO: Implement unit test for TheMethodName"; AssertEx.That( method.ContainsComment(expectedComment), "Comment '{0}' not found in: {1}", expectedComment, method.ContainsCommentMsg()); AssertEx.That( method.ContainsAttribute("Test"), "Attribute 'Test' not found in: {0}", method.ContainsAttributeMsg()); AssertEx.That(method.HasReturnTypeOf(typeof(void))); }