Hi
I am having problems with moq again and not sure what I did wrong this time.
So I am going through the debugger step by step and I notice even though in my Mock I set
ResetPassword to return "hey it does not seem to
Here is part of my unit test:
var membershipMock = new Mock<MembershipProvider>();
var user = new Mo...
Hi
I've read in blogs that the database should not be hit when the unit tests run. I understand the theory, however say i have complex store procedures that are part of a business domain operation. I want to write a set of unit tests for the code related to the business operation, however if i mock the database i have the feeling that im...
I'm working on a scientific computing code (written in C++), and in addition to performing unit tests for the smaller components, I'd like to do regression testing on some of the numerical output by comparing to a "known-good" answer from previous revisions. There are a few features I'd like:
Allow comparing numbers to a specified tole...
In a Rails application I have a Test::Unit functional test that's failing, but the output on the console isn't telling me much.
How can I view the request, the response, the flash, the session, the variables set, and so on?
Is there something like...
rake test specific_test_file --verbose
...
In most software projects, defects originate from requirements, design, coding and defect corrections. From my experience the majority of defects originate from the coding phase.
I am interested in finding out what practical approaches software developers use to reduce defect injection rates.
I have seen the following appraoches used w...
I am trying to change my unit testing of ArcGIS, and start using mocks (I use rhino).
When I started to get into writing the tests, I noticed I have to start mocking a lot of objects, and stub a lot of methods for even a single test to pass.
For example - my controller first gets a RelationshipClass (so I need to stub the IWorkspace and ...
Hi
So I have some SMTP stuff in my code and I am trying to unit test that method.
So I been trying to Mockup MailMessage but it never seems to work. I think none of the methods are virtual or abstract so I can't use moq to mock it up :(.
So I guess I have to do it by hand and that's where I am stuck.
*by hand I mean witting the inter...
Is okay to break all dependencies using interfaces just to make a class testable? It involves significant overhead at runtime because of many virtual calls instead of plain method invocations.
How does test driven development work in real world C++ applications? I read Working Effectively With Legacy Code and fond it quite useful but do...
Assuming that I have a CronTriggerBean similar to
<bean id="midMonthCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="reminderJobDetail" />
<property name="cronExpression" value="0 0 6 15W * ?" />
</bean>
What is the best way to test that this bean will actually trigger...
So I have a factory class and I'm trying to work out what the unit tests should do. From this question I could verify that the interface returned is of a particular concrete type that I would expect.
What should I check for if the factory is returning concrete types (because there is no need - at the moment - for interfaces to be used)...
What best practices have you used in unit testing embedded software that are peculiar to embedded systems?
...
I don't know what and when happend on my code but I got hundereds similar erros (not failures)
of this :
NameError: uninitialized constant ActiveSupport::Callbacks::Callback::NORMAL
And my tests function just go useless now, as even I put something like:
should "failed" do
assert false
end
It still returns passed, any idea ?
...
I am stuck with a problem when testing my controllers with RSpec - the response.body call always returns an empty string. In browser everything renders correctly, and cucumber feature tests seem to get it right, but RSpec fails each and every time.
Other expectations on the response object, such as response.should render_template('index...
How do Visual Studio's testing tools compare to third-party frameworks like NUnit? Are there any significant differences?
...
Suppose I have several services represented by classes ServiceA, ServiceB, ServiceC etc.
These services have configuration and other data in SQL, in for example a ServiceConfiguration table.
Are there any best practices for linking ServiceA to it's corresponding configuration and data in SQL other than hard-coding the Id in the class?
...
Our application has a service layer and a DAO layer, written as Spring beans.
While testing the Service Layer- I do not want to depend upon a real database so I am mocking that by creating a 'Mock' Impl for the DAO layer
So when I am testing the Service layer- I chain the Service layer beans to the Mock DAO beans
And in Production- wil...
If I'm running a suite of tests, is there a reason I would NOT want to collect code coverage data for the tests?
What's the expected cost, in terms of runtime, storage, or anything else?
I'm trying to decide if I would ever want to run with code coverage data collection OFF.
...
I've got a method in a class that's writing to some string, which calls another method which does the same. Something like:
void foo() {
a += "xyx";
bar();
}
void bar() {
a += "abc";
}
For unit testing purposes, I want to test foo and bar separately. Is there any way to prevent bar from being run when I call foo() or to replace...
Is anyone aware of any legal precedents where the lack of unit testing in an application has lost someone a case
Or where someone has not been deemed negligent despite a lack of unit testing in an application.
Is there any highly regarded alternative to unit-testing that enables programmers to objectively demonstrate a committment to sof...
On Proggit today I was reading the comment thread on a submission entitled, "Why Unit Testing Is A Waste of Time".
I'm not really concerned with premise of the article so much as I am with a comment made concerning it:
The stem of the problem is that most “units” of code in business software
projects are trivial.
Change the s...