How to write code to test the code of another class?

So I'm supposed to write code to test a method from a test class however I'm totally lost. I guess I'm just confused whether I have to right regular code such as for loops or if I'm able to do it another way. I'm new to java and it's causing me a ton

Browserstack Selenium Automation HUB

I am following browserstack's documentation on using automation and currently getting an error and am abit confused about the URI. My code looks like the following: using System; using OpenQA.Selenium; using OpenQA.Selenium.Remote; namespace Selenium

expected = JSONException.class does not catch

I made a Test where I send an invalid JSON, and it should catch me a JSONException. When I run the test, it fails and shows me a JSONException, Why doesn't test catch it? @Test (expected = JSONException.class) public void testExtraFieldsJsonException

Random chains with unit tests of given length

I have a program that is generating pseudo random numbers(Only lowercase, uppercase and digits are allowed). /** * * @return - returns a random digit (from 0 to 9) * */ int randomDigits() { return (int) (Math.random() * 10); } /** * * @return - retur

Android app performance test

I have developed an app which make connection to MySQL database and display some information from there. Is there a way to test performance of app like simulation of different amount of users request. 500 HTTP requests 1000, 1500 request.Try with JMe

How to get PHP error messages via CURL

I'm writing a PHP CLI testing tool for large Websites. It checks the HTTP Response Code on Websites written in PHP. The tool works with cURL. But if i get not the expected status code (expected should be 200, but I get 500), I don't know why. Is ther

Function running as a timer goes down?

I'm really new to programming and I'm trying to create a maths quiz for young children. They have to answer as many questions as they can in 60 seconds. I have a timer and a question generator The problem is however, I cant get them to run at the sam

How & quot; assert_select & rdquo; works in Rails

I was trying the following test in my Rails app: test "markup need for is in place" do get :index assert_select '.store .entry > img', 3 assert_select '.entry input[type=submit]', 3 end The test is all ok, I haven't failures o

Rspec tests instance variables with user creation

I'm testing to make sure that a created user is assigned to my instance variable @user. I understand what get means, but I'm not sure what to write for the test. I'm returning with an argument error for a bad URI or URL. What's wrong with my test and

classes and methods in python

import unittest from paycheck import with_checker class TestStrings(unittest.TestCase): @with_checker([int]) def test_sort(self, list_of_ints): self.assertTrue(isinstance(list_of_ints, list)) self.assertTrue(len(list_of_ints) == len(qsort(list_of_int

How to test @DELETE relying service call from JMeter

I am trying to find how to issue a call to the following restful service from JMeter: @DELETE @Path("/user") void removeUser(String userId); There are plenty examples on POST, GET, but I cannot find one for delete. Specifically, I cannot find a

What is the best way to test Perl modules during development?

I'm working on a personal Perl module to build a basic script framework and to help me learn more about the language. I've created a new module called "AWSTools::Framework" with ExtUtils::ModuleMaker via the command line tool modulemaker. I'm tr

MVC test actions based on HTTPContext

I have a project where I need to provide action tests. My approuch has been to ensure actions do not rely on anything they do not receive as parameters, maing use of ValueProviders and ModelBinders. As such I would pass in HTTPContextBase etc. Howeve

Vocabulary suitable for Test Case

I am sorry if this doesn't pertain to a specific programming work but it is closely related to writing testing cases. I am in the process of translating IT test cases written in Japanese and I was wondering what are the English equivalent words to de

How to use Moq to return a list of data or values?

Can anyone tell me how to return List of data using mock object using Moq framework and assigning the so returned list of data to another List<> variable.?? public class SomeClass { public virtual List<int> GimmeSomeData() { throw new NotImple

ruby cucumber analysis practices

I have many cucumber feature files, each consists of many scenarios. When run together, some of them fails. When I run each single test file, they passes. I think my database is not correctly clean after each scenario. What is the correct process to

Automated Test Best Practices for the CRUD Web Application

G'day, I'm working with a fairly DB heavy web app and looking at setting up automated testing for it using Selenium. However, as an automated testing newbie, I don't know where to start. How do you categorize your tests to make sure they're logically

Simultaneous data structure test

What are some methods for testing concurrent data structures to make sure the data structs behave correctly when accessed from multiple threads ?All of the other answers have focused on actually testing the code by putting it through its paces and ac

Selenium Tutorials

I have been trying my hands on opensource tool selenium, i was actually looking for selenium video tutorials. I haven't found any good resources. I know there is documentation for selenium. But am more interested in video tutorials. Any help in sugge

How to ignore and error in Visual Studio WebTests

I'm using Visual Studio to record some web tests. I'd like the test to pass (obviously), but it is failing because of something out of our control - so I'd like to surpress that failure. One of our pages is using an API from a third party like say, l

Is there a consensus on the test frameworks for Ruby 1.9.x?

A two-parter with a quick intro. Intro: I'm coming to Ruby from Perl, and I'm a bit lost among the test framework choices. I understand that there is probably no single, all-around best choice, but I can't even get a clear picture of the playing fiel