I'm trying to find some best-practice examples (or any examples, actually) of using Machine.Specifications with the ASP.Net Entity Framework in an MVC project.
Not having had much experience with Machine.Specifications, I'm keen to see what sort of tests other people find useful and whether there are any gotchas for using the EF-generat...
I'm going through the EdgeCase Ruby Koans. In about_dice_project.rb, there's a test called "test_dice_values_should_change_between_rolls", which is straightforward:
def test_dice_values_should_change_between_rolls
dice = DiceSet.new
dice.roll(5)
first_time = dice.values
dice.roll(5)
second_time = dice.values
...
Hello all, I'm facing a nuisance when coding my unit tests using UnitTest++. I'm wondering how to access private member class fields in a clean way (or maybe any way...)
By now, I have a solution to access protected members using a class fixture deriving from the class under test. The following code shows the idea:
struct MyFixture : C...
I have prepared some authomatic tests with the Visual Studio Team Edition testing framework. I want one of the tests to connect to the database following the normal way it is done in the program:
string r_providerName = ConfigurationManager.ConnectionStrings["main_db"].ProviderName;
But I am receiving an exception in this line. I supp...
Here's my situation - I have a helper named LayoutHelper that I use to help me build my layout, and I'm trying to test the following method.
It has a method in LayoutHelper that looks similar to this:
def show_login_form?
return false if @hide_login_form || logged_in?
return true
end
I also have the following in my application.rb...
I have following tests structure:
public class WorkerServiceTest {
public class RaiseErrorTest extends AbstractDbUnitTest{
@Test
public void testSomething(){
}
...
}
...
}
It's done because I don't want to create a separate class file for every test case extending AbstractDbUnitTest.
Th...
I'm writing NUnit tests for a service.
I've decided to do this by sending direct SQL statements to the database instead of using the Entity Framework model so that I could be certain of the results, i.e. I am testing what is in the database and not what the Entity Framework tells me is in the database (e.g. it could be reporting a cache...
I've recently started using git, and also begun unit testing (using Python's unittest module). I'd like to run my tests each time I commit, and only commit if they pass.
I'm guessing I need to use pre-commit in /hooks, and I've managed to make it run the tests, but I can't seem to find a way to stop the commit if they tests fail. I'm ru...
I have a test case:
class LoginTestCase(unittest.TestCase):
...
I'd like to use it in a different test case:
class EditProfileTestCase(unittest.TestCase):
def __init__(self):
self.t = LoginTestCase()
self.t.login()
This raises:
ValueError: no such test method in <class 'LoginTest: runTest`
I looked at the unittest ...
When i run unit tests it fails on loading external resources (images) with the same error as if they don't exist. In xcode i have added the resources to the unit test target. I don't know what to try next.
I am using the Cocos2d framework, I try to load the following code within a unit test
AtlasSpriteManager *at = [AtlasSpriteManage...
Some functionality in my app works differently depending on the client's IP address. Is there a way to test that in Rails functional tests? I'm using Test::Unit and Shoulda.
...
VSTS 2008 (Visual Studio Team System) is coming with inbuilt Unit Testing Feature. We can add a test project to perform unit testing over the Smart device project. The problem comes when my smart device project is not using Framework 3.5 but over Framework 2.0. I strictly not to install Framework 3.5 in the device.
But this restriction ...
I am writing a paper for a scientific conference. Just to be thorough, in that paper I said I made unit tests for the components in the system among all the other tests (system testing, usability etc) I made.
In the results section, for the unit tests I simply said that all the tests passed. I submitted the draft to my adviser and now ...
I just discovered that I was getting twice the number of tests run that I should've been getting. Discovered it when a test broke and I got two identical test failures. Same test, same everything. Got me quite confused, but managed to narrow it down to a certain test class that was a partial class.
The reason it was a partial class was ...
What is currently the best solution to automate running unit tests against silverlight applications within CruiseControl.NET?
Preferably I would like to run MSTest unit tests however as these aren't officially supported for silverlight yet I am open to suggestions that use other testing frameworks.
...
I am writing my first Android database backend and I'm struggling to unit test the creation of my database.
Currently the problem I am encountering is obtaining a valid Context object to pass to my implementation of SQLiteOpenHelper. Is there a way to get a Context object in a class extending TestCase? The solution I have thought of i...
I have similar methods, in the Business layer. New to unit testing and sometimes get confused. For an idea, can you suggest, what will be a better approach to test this method
behaviour? I am using C# NUnit and Moq
public int? AddNewCatRetID(string categoryName)
{
int? categoryID = 0;
Adapter.AddNewBlogCategoryReturnID(categ...
We've been trying write unit tests for a worker class written in C#, which mocks out a third party API (COM based) using moq to dynamically create the mock objects. NUnit is our unit testing framework.
This third party component implements a couple of interfaces, but also needs to call back into our worker class using events. Our plan w...
It seems that the common theme among SO questions regarding WatiN have to do with actually getting the thing working and I'm no exception.
I've downloaded the latest release of WatiN (2.0.20.1089) and am trying to create the NUnit / WatiN equivalent of Hello, World:
using WatiN.Core;
using NUnit.Framework;
namespace Foo.Browser.Tests
...
There is a number of unit test frameworks for most of the languages, but I haven't come across a unit test for GNU make. It has conditionals, loops (the $(foreach ...) statement), and allows to write pretty sophisticated code. The examples might be things like BSD ports, GARNOME, and OpenCSW GAR.
There's also a debugger for GNU make....