Created
June 6, 2012 14:15
-
-
Save xenda/2882107 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Using NUnit | |
[TestFixture] | |
public class HibernateTitleDaoTests : AbstractDependencyInjectionSpringContextTests { | |
// this instance will be (automatically) dependency injected | |
private HibernateTitleDao titleDao; | |
// a setter method to enable DI of the 'titleDao' instance variable | |
public HibernateTitleDao HibernateTitleDao { | |
set { titleDao = value; } | |
} | |
[Test] | |
public void LoadTitle() { | |
Title title = this.titleDao.LoadTitle(10); | |
Assert.IsNotNull(title); | |
} | |
// specifies the Spring configuration to load for this test fixture | |
protected override string[] ConfigLocations { | |
return new String[] { "assembly://MyAssembly/MyNamespace/daos.xml" }; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class TitleTest < ActiveSupport::TestCase | |
subject{ Title.new } | |
it "loads title" do | |
subject.should_not be_nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment