testing

Run junit test certain amount of time

混江龙づ霸主 提交于 2019-12-23 19:38:57
问题 I want to test something for a while, say 5 seconds, and then pass the test if nothing wrong has been asserted. Is this possible with annotations? Can something like @Test(uptime=5000) be used? 回答1: Revised answer after question was edited Fundamentally it feels like you're testing the wrong thing here - it seems very odd for "nothing happening" to be a sign of success. If you want to prove that your algorithm can run for a certain amount of time without failing, I would actually extract out

Using Test Doubles with DbEntityEntry and DbPropertyEntry

落花浮王杯 提交于 2019-12-23 19:23:16
问题 I am using the new Test Doubles in EF6 as outlined here from MSDN . VS2013 with Moq & nUnit. All was good until I had to do something like this: var myFoo = context.Foos.Find(id); and then: myFoo.Name = "Bar"; and then : context.Entry(myFoo).Property("Name").IsModified = true; At this point is where I get an error: Additional information: Member 'IsModified' cannot be called for property 'Name' because the entity of type 'Foo' does not exist in the context. To add an entity to the context

Why does the new gradle test filtering feature not work for my build script?

若如初见. 提交于 2019-12-23 19:17:30
问题 I am working on a "project" that has the following structure: proj - dbfit-junit/module - db1 - db2 To provide some background information: All of these "modules" (db1, db2) have JUnit tests that use the FitNesseRunner to integrate them in Bamboo. My gradle script looks like following: apply plugin: 'java' repositories { mavenCentral() } dependencies { compile files(fileTree("lib")) testCompile "junit:junit:4.11" } ext { dbFitModuleDir = file("dbfit-junit/module") dbFitModules =

Testing LDAP Connections to Active Directory Server

妖精的绣舞 提交于 2019-12-23 19:15:35
问题 I'm writing a Linux application that accesses a LDAP server (currently OpenLDAP). I would like to also test the application with an Active Directory server since that might be used in production. Is there any free demo or trial version from Microsoft that would allow me to run this test in a VM ? 回答1: Yes, you can download a evaluation copy of Windows Server 2008 R2. You have 180 days to do your evaluation. After you successfully install the Windows Server 2008 R2, you just click Windows

Unit Testing Frameworks for Visual Studio 2012 Cons/Pros

别等时光非礼了梦想. 提交于 2019-12-23 19:09:54
问题 I want to get started on Unit Testing in C++ (pure C++, not .NET), since I have never done it before. Always used assert and cout . So far, the only good Question with detailed answers, I have found is https://stackoverflow.com/questions/13699/choosing-a-c-unit-testing-tool-framework, but it is dated to 2008. I would like to hear some opinions about currently available C++ Unit Testing compatible with Visual Studio 2012. What are their Cons and Pros ? How easy/hard to learn them(i.e

py.test logging messages and test results/assertions into a single file

时光毁灭记忆、已成空白 提交于 2019-12-23 18:28:26
问题 I am starting to work with py.test at the moment for a new project. We are provisioning Linux servers and I need to write a script to check the setup and configuration of these servers. I thought that py.test is a good way to implement these tests and it is working quite fine until now. The problem I face right now is that I need a log file at the end of these tests showing some log messages for each test and the result of the test. For the log messages I use logger: logging.basicConfig

How do I use Capybara get, show, post, put in controller tests?

拟墨画扇 提交于 2019-12-23 18:25:22
问题 I'm just not sure what the exact way to word it is.. This tells me 'No response yet. Request a page first.' it "should list searches" do get 'index' page.should have_selector('tr#search-1') end Is it meant to be like this instead? it "should list searches" do get 'index' do page.should have_selector('tr#search-1') end end That way doesn't seem to actually test anything though. What's the correct way? 回答1: According to this, Capybara doesn't support PUT and DELETE requests with the default

Yii Fixtures Issue?

左心房为你撑大大i 提交于 2019-12-23 17:43:54
问题 I seem to be having a problem with fixtures in Yii. The problem seems to be the following, public $fixtures=array('projects'=>'Project'); The model Project exists and I have the fixtures in a file name tbl_project.php in the fixtures folder of tests and my table name is called tbl_project. Inside the fixtures file is the following. return array( 'project1' => array( 'name' => 'Test Project 1', 'description' => 'This is test project 1', 'create_time' => '', 'create_user_id' => '', 'update_time

Laravel 5.1 - Testing a multiple selectbox

余生颓废 提交于 2019-12-23 17:24:35
问题 I'm experiencing trouble when I write my tests for a multiple select box with the Laravel 5.1 testing helpers. I've tried both storeInput and select which is kinda much an alias for storeInput. When I'm working with a multiple select and I want the input to be formatted as an array I've created a <select name="roles[]"> but this is not testable, I can't write something like this $this->storeInput( 'roles[]', [ 1, 2 ] ) . The errors I get then are: Symfony\Component\CssSelector\Exception

Rails 3, too many ways to test?

喜欢而已 提交于 2019-12-23 16:53:40
问题 If you were just starting out in rails which path would you encourage new users to go down with regards to Testing . Anything I read about regarding Rails 3, tells me I should be using Rspec 2 . But Rspec comes with a whole whack of other things I need to learn like gem 'capybara' gem 'database_cleaner' gem 'cucumber-rails' gem 'cucumber' gem 'spork' gem 'launchy' And then one of my friends just told me that I should just stick to the testing framework that comes with rails, and maybe just