Hello,
I've read through some of the discussions on the Moq user group and have failed to find an example and have been so far
unable to find the scenario that I have. Here is my question and code:
// 6 periods
var schedule = new List<PaymentPlanPeriod>()
{
new PaymentPlanPeriod(1000m, args.MinDate.ToString()),
new PaymentPla...
With PHPUnit it's quite easy to test raw PHP code, but what about code that heavily relies on cookies? Sessions could be a good example.
Is there a method that doesn't require me to setup $_COOKIE with data during my test? It feels like a hacky way of doing things.
...
I need to create unit tests for J2EE components like Servlets, Filters and JPA code which would call it's life cycle methods automatically and would integrate with Maven2 and Continuum and can be run from IDE itself.
Can you suggest something?
Thanks,
Vaibhav
...
During testing I have a mock object which sets errno = ETIMEDOUT; The object I'm testing sees the error and calls strerror_r to get back an error string:
if (ret) {
if (ret == EAI_SYSTEM) {
char err[128];
strerror_r(errno, err, 128);
err_string.assign(err);
} else {
err_string.assign(gai_strerror...
I am porting over some C++ assembly to VB that performs demodulation of various waveforms. I decided to go the unit test route instead of building a test app to get a feel for how testing is performed. The original demodulation code accepts an array that is the waveform along with some other arguments. How should one go about performi...
I have two projects in my solution. One is a MFC project which shows a simple GUI saying "Hllo World"
If I compile the MFC Application Project as Application (exe) it runs without problems.
What I want to do now is to show the window from my UnitTest. (Doesn't make much sens, but it has to be like that). Therefore the MFC application i...
I am trying to set up Google App Engine unit testing for my web application. I downloaded the file from here.
I followed the instructions in the readmen by copying the directory gaeunit into the directory with the rest of my apps and registering 'gaeunit' in settings.py. This didn't seem sufficient to actually get things going. I als...
I am having trouble getting my filters/validators to work correctly on my form, so I want to create a Unit test to verify that the data I am submitting to my form is being filtered and validated correctly.
I started by auto-generating a PHPUnit test in Zend Studio, which gives me this:
<?php
require_once 'PHPUnit/Framework/TestCase.php...
I'm trying out TDD on a greenfield hobby app in ASP.NET MVC, and have started to get test methods such as the following:
[Test]
public void Index_GetRequest_ShouldReturnPopulatedIndexViewModel()
{
var controller = new EmployeeController();
controller.EmployeeService = GetPrePopulatedEmployeeService();
var actionResult = (Vi...
I'm doing unit testing for our WCF RIA services, which have RequiresRole or RequiresAuthentication attributes attached to them. I've been able to test the Update, Insert, and Delete methods to ensure the attributes are properly set. This is done by mocking a IServiceProvider, creating a DomainServiceContext with that provider and the cor...
I realize this has been asked before, but the last time was in mid 2008.
If you were starting a new project right now, which one would you use and why? What are their strengths/weaknesses regarding readability, usability, maintainability, and overall robustness?
...
Hello,
I am a ruby and rails newbie. And I am working on a rails application with RadRails. RadRails has a "Switch to Test" function for my controller, model, etc. but not for my library. if I have class Foo::Bar in /lib/foo/bar.rb, where should I put the unittest for it?
or should I separate the foo library in a separated project?
Th...
Hi,
I am currently experimenting with TFS, and I really like it.
One small question, regarding test files:
I have a directory with some demo TXT, images, dirs... These are used during tests, so up until now, the path was hardcoded to a folder on my computer. Now I need to change this, of course, the TFS need access to the files too.
My...
I am using Active MQ for integration testing my application. I have defined an active-mq broker in a spring config like so:
<amq:broker useJmx="false"
persistent="false"
deleteAllMessagesOnStartup="true"
useShutdownHook="true">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://...
I am developing a data-flow oriented domain-specific language. To simplify, let's just look at Operations. Operations have a number of named parameters and can be asked to compute their result using their current state.
To decide when an Operation should produce a result, it gets a Decision that is sensitive to which parameter got a val...
I am embarking upon my first journey of test driven development in C#. To get started I'm using MSTest and Rhino.Mocks. I am attempting to write my first unit tests against my ICustomerRepository. It seems tedious to new up a Customer for each test method. In ruby-on-rails I'd create a seed file and load the customer for each test. It se...
Intro:
I've seen lots of topics here on SO about software testing and other terms I don't understand.
Problem:
As a beginner developer I, unfortunately, have no idea how software testing works, not even how to test a simple function. This is a shame, but thats the truth. I also hope this question can help others beginners developers t...
Hi,
I've just started an MVC 2.0 solution using Unity 2.0. I thought it would be a good idea to create my Unity Container with all the RegisterType calls within a separate assembly to allow me to reuse it throughout my Unit Tests. However, I quickly realised I'd end up with circular references regardless of unit testing. My MVC appli...
Pretty simple test:
[TestClass]
public class MyTestClass
{
private TestContext _testContext;
protected TestContext TestContext
{
get { return _testContext; }
set { _testContext = value; }
}
[TestMethod]
[HostType("ASP.NET")]
[UrlToTest("http://localhost/MyPage.aspx")]
public void TestMyPa...
It seems exceptionally heavy handed but going by the rule anything publicly available should be tested should auto-implemented properties be tested?
Customer Class
public class Customer
{
public string EmailAddr { get; set; }
}
Tested by
[TestClass]
public class CustomerTests : TestClassBase
{
[TestMethod]
public void Ca...