Search Results

Search found 10010 results on 401 pages for 'a b testing'.

Page 114/401 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • Safari 5 vs. Safari 4 : Are there any compatibility differences?

    - by Cole
    I recently obtained a Mac so I could test our sites on Safari and Firefox for Mac OS. Now that Safari 5 is out, I'm not sure what I should do about upgrading. I presume what works on Safari 5 works on Safari 4, but I can't be sure, and vice versa. So, I don't know if I should upgrade and test on Safari 5 or keep on with Safari 4. Are there any major differences between these two version in terms of CSS (2.1) handling or JavaScript? When do you think the majority of people will have Safari 5 instead of 4? All thoughts appreciated.

    Read the article

  • [C++] Boost test: catch user defined exceptions

    - by user231536
    If I have user defined exceptions in my code, I can't get Boost test to consider them as failures. For example, BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MyTest,1) BOOST_AUTO_TEST_CASE(MyTest) { // code which throws user defined exception, not derived from std::exception. } I get a generic message: Caught exception: .... unknown location(0):.... It does not recognize this error as a failure since it is not a std::exception. So it does not honor the expected_failures clause. How do I enforce that the piece of code should always throw an exception? THis seems to be a useful thing to want. In case future code changes cause the code to pass and the exception is not thrown, I want to know that.

    Read the article

  • How do I get the name of the test method that was run in a testng tear down method?

    - by Zachary Spencer
    Basically I have a tear down method that I want to log to the console which test was just run. How would I go about getting that string? I can get the class name, but I want the actual method that was just executed. Class testSomething() { @AfterMethod public void tearDown() { system.out.println('The test that just ran was....' + getTestThatJustRanMethodName()'); } @Test public void testCase() { assertTrue(1==1); } } should output to the screen: "The test that just ran was.... testCase" However I don't know the magic that getTestThatJustRanMethodName should actually be.

    Read the article

  • How to know if your Unit Test Fixture is “right-sized”?

    - by leeand00
    How do you know if you "Test Fixture" is right-sized. And by "Test Fixture" I mean a class with a bunch of tests in it. One thing that I've always noticed with my test fixtures is that they get to be kind of verbose; seeing as they could also be not verbose enough, how do you get a sense of when your unit tests are the right size? My assumption is that (at least in the context of web development) you should have one test fixture class per page. I know of a good quote for this and it's: "Perfection is achieved, not when there is nothing left to add, but when there is nothing left to remove." - Antoine de Saint-Exupery.

    Read the article

  • How can I know when SQL Full Text Index Population is finished?

    - by GarethOwen
    We are writing unit tests for our ASP.NET application that run against a test SQL Server database. That is, the ClassInitialize method creates a new database with test data, and the ClassCleanup deletes the database. We do this by running .bat scripts from code. The classes under test are given a connection string that connects to the unit test database rather than a production database. Our problem is, that the database contains a full text index, which needs to be fully populated with the test data in order for our tests to run as expected. As far as I can tell, the fulltext index is always populated in the background. I would like to be able to either: Create the full text index, fully populated, with a synchronous (transact-SQL?) statement, or Find out when the fulltext population is finished, is there a callback option, or can I ask repeatedly? My current solution is to force a delay at the end the class initialize method - 5 seconds seems to work - because I can't find anything in the documentation.

    Read the article

  • How to write unit tests for an object having multiple properties

    - by jess
    Hi, I have various objects in application,and each has isvalid method to test if values of all properties are set correctly(as per business rules).Now,to test that for each violation isvalid throws false,i will have to write as many tests as rules being checked in isvalid.Is there a simpler way to do this? I am using MBunit.

    Read the article

  • how many lines of code does my class library have

    - by zachary
    for metrics reasons I need to know how many lines of code my class library has. I'm doing this for code coverage.... So if Class library 1 has 50 lines of code and 100% coverage And if Class library 2 has 500 lines of code and 0% coverage My total coverage is 90% Any idea how to do this? Is there a utility or a way to use Visual Studio?

    Read the article

  • why assert_equal() in Ruby on Rails sometimes seem to compare by Identity and sometimes by value?

    - by Jian Lin
    it was very weird that yesterday, I was do an integration test in Rails and assert_equal array_of_obj1, array_of_obj2 # obj1 from db, obj2 created in test and it failed. The values shown inside the array and objects were identical. If I change the test to assert array_of_obj1 == array_of_obj2 Then it will pass. But today, the first test actually passed. What reason could it be? Is assert_equal always using == or .equal? in Rails 2.2 or 2.3.5?

    Read the article

  • rake test fails

    - by Pavel K.
    i have a model (simplified) class Myfile < ActiveRecord::Base validates_attachment_size :body, :less_than => AdminOptions.first.max_file_size.megabytes end max_file_size is defined in AdminOptions fixture, but when i try to run "rake test", i get: /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing': undefined method `max_file_size' for nil:NilClass (NoMethodError) from /myapp/app/models/myfile.rb:1 if i run ruby test/unit/myfile_test.rb i get same mistake. if i run: RAILS_ENV=test rake db:load:fixtures ruby test/unit/myfile_test.rb tests execute properly. if i try to RAILS_ENV=test rake db:load:fixtures rake test it fails with same mistake. does anyone know how to fix that?

    Read the article

  • Are there any test data generator tools which can be used with selenium/Nunit?

    - by Jon
    Hi, I was wondering if there was anything that provides test data for injecting into Nunit tests? I'm sure I came across something recently that does this but I couldn't find it again. Basically the idea is that I could use selenium and Nunit to create new customers within the system automatically. So I could have selenium type in customer names generated from test generator (the < DataGenerator is just an imaginary class): e.g. dim sFirstName as string = < DataGenerator >.GetRandomFirstName() dim sLastName as string = < DataGenerator >.GetRandomLastName() selenium.type("firstname_field",sFirstName) selenium.type("lastname_field",sLastName ) I've already seen SQLDataGenerator from Redgate which has a cmd line wrapper class, but I was wondering if there was anything else.

    Read the article

  • TDD, Unit Test and architectural changes

    - by Leandro
    I'm writing an RPC middleware in C++. I have a class named RPCClientProxy that contains a socket client inside: class RPCClientProxy { ... private: Socket* pSocket; ... } The constructor: RPCClientProxy::RPCClientProxy(host, port) { pSocket = new Socket(host, port); } As you can see, I don't need to tell the user that I have a socket inside. Although, to make unit tests for my proxies it would be necessary to create mocks for sockets and pass them to the proxies, and to do so I must use a setter or pass a factory to the sockets in the proxies's constructors. My question: According to TDD, is it acceptable to do it ONLY because the tests? As you can see, these changes would change the way the library is used by a programmer.

    Read the article

  • Simple Java AMPQ server

    - by splix
    Are there exists an simple AMPQ server/broker implementation written in Java? I need it only for local integration tests, starting it from ant/maven, and i don't need any features like a clustering, persistence, performance and so on. Just a fake RabbitMQ-like instance, without installation (just as a dependency at maven pom) and configuration.

    Read the article

  • DomDocument::loadHTML() error during phpunit test execution

    - by ranhan
    I am currently trying to write some unit test against my zend framework controller. When I run the following code I receive this error: public function testListActionShouldContainListTable() { $this->loginToSystem(); $uri = $this->_uriBase . 'campaign/list'; $_SERVER["REQUEST_URI"] = $uri; $this->dispatch('/campaign/list'); $this->assertController('campaign'); $this->assertAction('list'); $this->assertQueryCount('#list',1); } CampaignControllerTests::testListActionShouldContainListTable DOMDocument::loadHTML(): ID alrt already defined in Entity, line: 36 This occurs using any of the assertQuery and assertQueryContains methods. I have searched around but am not really finding a good answer to why it won't allow me to find this html node or how to get around this error. Thanks in advance for any help!

    Read the article

  • Why is my rspec test failing?

    - by Justin Meltzer
    Here's the test: describe "admin attribute" do before(:each) do @user = User.create!(@attr) end it "should respond to admin" do @user.should respond_to(:admin) end it "should not be an admin by default" do @user.should_not be_admin end it "should be convertible to an admin" do @user.toggle!(:admin) @user.should be_admin end end Here's the error: 1) User password encryption admin attribute should respond to admin Failure/Error: @user = User.create!(@attr) ActiveRecord::RecordInvalid: Validation failed: Email has already been taken # ./spec/models/user_spec.rb:128 I'm thinking the error might be somewhere in my data populator code: require 'faker' namespace :db do desc "Fill database with sample data" task :populate => :environment do Rake::Task['db:reset'].invoke admin = User.create!(:name => "Example User", :email => "[email protected]", :password => "foobar", :password_confirmation => "foobar") admin.toggle!(:admin) 99.times do |n| name = Faker::Name.name email = "example-#{n+1}@railstutorial.org" password = "password" User.create!(:name => name, :email => email, :password => password, :password_confirmation => password) end end end Please let me know if I should reproduce any more of my code. UPDATE: Here's where @attr is defined, at the top of the user_spec.rb file: require 'spec_helper' describe User do before(:each) do @attr = { :name => "Example User", :email => "[email protected]", :password => "foobar", :password_confirmation => "foobar" } end

    Read the article

  • Rspec: "array.should == another_array" but without concern for order

    - by nicholaides
    I often want to compare arrays and make sure that they contain the same elements, in any order. IS there a consise way to do this in RSpec? Here are methods that aren't acceptable: #to_set For example: array.to_set.should == another_array.to_set This fails when the arrays contain duplicate items. #sort For example: array.sort.should == another_array.sort This fails when the arrays elements don't implement #<=> #size and #to_set For example: array.to_set.should == another_array.to_set array.size.should == another_array.size This would work, but there's got to be a better way.

    Read the article

  • Best practices to test protected methods with PHPUnit

    - by GrGr
    Hello, I found the discussion on Do you test private method informative. I have decided, that in some classes, I want to have protected methods, but test them. Some of these methods are static and short. Because most of the public methods make use of them, I will probably be able to safely remove the tests later. But for starting with a TDD approach and avoid debugging, I really want to test them. I thought of the following: Method Object as adviced in an answer seems to be overkill for this. Start with public methods and when code coverage is given by higher level tests, turn them protected and remove the tests. Inherit a class with a testable interface making protected methods public Which is best practice? Is there anything else? It seems, that JUnit automatically changes protected methods to be public, but I did not have a deeper look at it. PHP does not allow this via reflection.

    Read the article

  • Creating a System.Windows.Controls.Image throws an exception - how do I use the dispatcher to instan

    - by Scott Whitlock
    I'm running my unit tests on a piece of code that does the following in the test: Assert.IsNotNull(target.Icon); Inside the getter for the Icon property, I'm doing this: System.Windows.Controls.Image img = new System.Windows.Controls.Image(); That's throwing this exception: System.InvalidOperationException : The calling thread must be STA, because many UI components require this. I understand what that means, and I understand that I need to use the Dispatcher, but I'm a bit confused about how or why... this is a property of my ViewModel and I don't get any of these exceptions when running the application. Other info: this only started failing when I upgraded to .NET 4.

    Read the article

  • Speed of running a test suite in Rails

    - by Milan Novota
    I have 357 tests (534 assertions) for my app (using Shoulda). The whole test suite runs in around 80 seconds. Is this time OK? I'm just curious, since this is one of my first apps where I write tests extensively. No fancy stuff in my app. Btw.: I tried to use in memory sqlite3 database, but the results were surprisingly worse (around 83 seconds). Any clues here? I'm using Macbook with 2GB of RAM and 2GHz Intel Core Duo processor as my development machine.

    Read the article

  • NUnit [Test] is not a valid attribute

    - by tyndall
    I've included the necessary assemblies into a Windows Class project in VS2008. When I start to try to write a test I get a red squiggle line and the message [Test] is not a valid attribute. I've used NUnit before... maybe an earlier version. What am I doing wrong? I'm on version 2.5.2. using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit; using NUnit.Core; using NUnit.Framework; namespace AccessPoint.Web.Test { public class LoginTests { [Test] public void CanLogin() { } } }

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >