I\'m just starting out with RSpec and having a little difficulty writing up controller tests for nested resources. I\'ve tried googling this, but without much luck.
I have a class I want to test. Here is the code:开发者_运维知识库 class MyClass { function functionToTest() {
I\'m developing a web application running on Tomcat 6, with Flex as Frontend. I\'m testing my backend with TestNG. Currently, I\'m trying to test the following method in my Java-Backend:
I might be missing something completely obvious here, but why do I have to do this: setup do @person = mock(\"person\")
import grails.plugin.spock.* class EventControllerSpec extends ControllerSpec { def \"Creating a breadcrumb from an event\"() {
I am trying to pass a mocked domain instance called event to the controllers\' show() method, but show() cannot find the Event in question and thus returns null.
I spend over 2 hours on this... i can\'t figure out why this test is PASSING. I mean.. it shouldnt return the view \"Completed\" but in the test it does! It say Expected \"string.Empty\" but returned
I am trying to create unittest of a service class - class which has EntityManager injected and is responsible for loading and creating entities.
I am using EasyMocks. Inside a method there is a new object created. And upon that object a method is called which returns a map. As show below
I am trying to learn and implement TDD specifically using Moq and I have come up against a design that I can\'t figure out how to mock: