Search Results

Search found 5783 results on 232 pages for 'translation unit'.

Page 19/232 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Unit Testing iPhone Code That Uses NSLocalizedString

    - by Jay Haase
    I have an iPhone iOS4.1 application that uses localized strings. I have just started building unit tests using the SenTestingKit. I have been able to successfully test many different types of values. I am unable to correctly test any of my code that uses NSLocalizedString calls, because when the code runs in my LogicTests target, all of my NSLocalizedString calls only return the string key. I have added my Localizable.strings file to the LogicTests target. My question is: How must I configure my LogicTests target so that calls to NSLocalizedString will return the localized string and not the string key.

    Read the article

  • Unit Testing Model Classes that derive from NSManagedObject

    - by Matt Baker
    So...I'm trying to get unit tests set up in my iPhone App but I'm having some issues. I'm trying to test my model classes but they inherit directly from NSManagedObject. I'm sure this is a problem but I don't know how to get around it. Everything is building and running as expected but I get this error when calling any method on the class I'm testing: Unknown.m:0:0 unrecognized selector sent to instance 0xc2b120 If I follow this structure (http://chanson.livejournal.com/115621.html) to create my object in my tests I end up with another error entirely but it still doesn't help me. Basically my question is this: how can I test a class that inherits from NSManagedObject?

    Read the article

  • Grails Unit testing a function with session object

    - by Suganthan
    I having a Controller like def testFunction(testCommand cmdObj) { if (cmdObj.hasErrors()) { render(view: "testView", model: [cmdObj:cmdObj]) return } else { try { testService.testFunction(cmdObj.var1, cmdObj.var2, session.user.username as String) flash.message = message(code: 'message') redirect url: createLink(mapping: 'namedUrl') } catch (GeneralException error) { render(view: "testView", model: [cmdObj:cmdObj]) return } } } For the above controller function I having a Unit test function like: def "test function" () { controller.session.user.username = "testUser" def testCommandOj = new testCommand( var1:var1, var2:var2, var3:var3, var4:var4 ) testService service = Mock(testService) controller.testService = service service.testFunction(var2,var3,var4) when: controller.testFunction(testCommandOj) then: view == "testView" assertTrue model.cmdObj.hasErrors() where: var1 | var2 | var3 | var4 "testuser" | "word@3" | "word@4" | "word@4" } When running this test function I getting the error like Cannot set property 'username' on null object, means I couldn't able to set up the session object. Can someone help to fix this. Thanks in advance

    Read the article

  • Unit Testing Model Classes that inherits from NSManagedObject

    - by Matt Baker
    So...I'm trying to get unit tests set up in my iPhone App but I'm having some issues. I'm trying to test my model classes but they inherit directly from NSManagedObject. I'm sure this is a problem but I don't know how to get around it. Everything is building and running as expected but I get this error when calling any method on the class I'm testing: Unknown.m:0:0 unrecognized selector sent to instance 0xc2b120 If I follow this structure (http://chanson.livejournal.com/115621.html) to create my object in my tests I end up with another error entirely but it still doesn't help me. Basically my question is this: how can I test a class that inherits from NSManagedObject?

    Read the article

  • Linker Error: iPhone Unit Test Bundle referencing App classes

    - by ohhorob
    Starting with an app already in development, I have carried out the instructions in the iPhone Development Guide – Unit Testing Applications I can successfully include and use my App's classes in Application-style tests that run on the device, and output their results to the console. If I add the following line of code: STAssertTrue([viewController isKindOfClass:[LoginViewController class]], @"Top view controller is not LoginViewController"); The following build error is generated: Undefined symbols: "_OBJC_CLASS_$_LoginViewController", referenced from: __objc_classrefs__DATA@0 in LoginViewTest.o ld: symbol(s) not found collect2: ld returned 1 exit status I can provide more configuration information for the project and the Testing target, but the setup works file without the [LoginViewController class] line in the test source. Without that line, I can reference the class, use it's properties and send it messages successfully. Is there a linking build setting, or bundle loading option that is required when attempting to use an App class in this fashion? Or should I find another type of test to confirm that the class of an object is the expected one?

    Read the article

  • Ruby on Rails: Unit Testing non activerecord models and still load fixtures

    - by Vaibhav Gumashta
    I may be missing something but I am stuck in this scenario: I have a non activerecord model, which I want to test. I have derived its test case class from: Test::Unit::TestCase. However, the test case class for the model, uses within itself, other activerecord model classes and I want to load fixtures for them. My problem is that the fixtures class method is available only when I subclass the test case class from ActiveSupport::TestCase (it is defined within ActiveRecord::TestFixtures which gets included in ActiveSupport::TestCase). Any help, coz running the tests gives me the error: undefined method "fixtures" (which is understandable) and in case I derive my test case class from ActiveSupport::TestCase it complains that there is no corresponding DB table. Also, I don't want to create a dummy table for backing my model class. Thanks a ton!

    Read the article

  • Convert C# unit test names to English (testdox style)

    - by Igor Zevaka
    I have a whole bunch of unit tests written in MbUnit and I would like to generate plain English sentences from test names. The concept is introduced here: http://dannorth.net/introducing-bdd This is from the article: public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ... } renders something like this: CustomerLookup - finds customer by id - fails for duplicate customers - ... Unfortunately the tool quoted in the above article (testdox) is Java based. Is there one for .NET? Sounds like this would be something pretty simple to write, but I simply don't have the bandwidth and want to use something already written.

    Read the article

  • Unit testing the app.config file with NUnit

    - by Dana
    When you guys are unit testing an application that relies on values from an app.config file? How do you test that those values are read in correctly and how your program reacts to incorrect values entered into a config file? It would be ridiculous to have to modify the config file for the NUnit app, but I can't read in the values from the app.config I want to test. Edit: I think I should clarify perhaps. I'm not worried about the ConfigurationManager failing to read the values, but I am concerned with testing how my program reacts to the values read in.

    Read the article

  • Entity Framework 4.0 Unit Testing

    - by Steve Ward
    Hi, I've implemented unit testing along the lines of this article with a fake object context and IObjectSet with POCO in EF4. http://blogs.msdn.com/adonet/archive/2009/12/17/test-driven-development-walkthrough-with-the-entity-framework-4-0.aspx But I'm unsure how to implement a couple of methods on my fake object context for testing. I have CreateQuery and ExecuteFunction methods on my object context interface so that I can execute ESQL and Stored Procedures but I cant (easily) implement them in my fake object context. An alternative would be to use a test double of my repository instead of a double of my object context as suggested here: http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/c4921443-e8a3-4414-92dd-eba1480a07ad/ But this would mean my real repository isnt being tested and would seem to just bypass the issue. Can anyone offer any recommendations?

    Read the article

  • Unit testing a controller in ASP.NET MVC 3

    - by Abdullah Al- Mansur
    public Double Invert(Double? id) { return (Double)(id / id); } I have done this for this test but fails please can anyone help with this cos just started with unit testing /* HINT: Remember that you are passing Invert an *integer* so * the value of 1 / input is calculated using integer arithmetic. * */ //Arrange var controller = new UrlParameterController(); int input = 7; Double expected = 0.143d; Double marginOfError = 0.001d; //Act var result = controller.Invert(input); //Assert Assert.AreEqual(expected, result, marginOfError); /* NOTE This time we use a different Assert.AreEqual() method, which * checks whether or not two Double values are within a specified * distance of one another. This is a good way to deal with rounding * errors from floating point arithmetic. Without the marginOfError * parameter the assertion fails. * */

    Read the article

  • Creating TCP network errors for unit testing

    - by Robert S. Barnes
    I'd like to create various network errors during testing. I'm using the Berkely sockets API directly in C++ on Linux. I'm running a mock server in another thread from within Boost.Test which listens on localhost. For instance, I'd like to create a timeout during connect. So far I've tried not calling accept in my mock server and setting the backlog to 1, then making multiple connections, but all seem to successfully connect. I would think that if there wasn't room in the backlog queue I would at least get a connection refused error if not a timeout. I'd like to do this all programatically if possible, but I'd consider using something external like IPchains to intentionally drop certain packets to certain ports during testing, but I'd need to automate creating and removing rules so I could do it from within my Boost.Test unit tests. I suppose I could mock the various system calls involved, but I'd rather go through a real TCP stack if possible. Ideas?

    Read the article

  • Framework/tool for processing C++ unit tests with numerical output

    - by David Claridge
    Hi, I am working on a C++ application that uses computer vision techniques to identify various types of objects in a sequence of images. The (1000+) images have been hand-classified, so we have an XML file for each image containing a description of where the objects are actually located in the images. I would like to know if there is a testing framework that can understand/graph results from tests that are numeric, in this case some measure of the error in the program's classification of the images, rather than just pass/fail style unit tests. We would like to use something like CDash/CTest for running these automated tests, and viewing over time how improvements to the vision algorithms are causing the images to be more correctly classified. Does anyone know of a tool/framework that can do this?

    Read the article

  • Visual Studio 2010 Not Recognizing Unit Test

    - by jmease
    In an existing solution I added a new Test Project. In my Test Project .cs file I have a class decorated with the [TestClass] attribute and a method decorated with the [TestMethod] attribute. I have verified that in Configuration Manager the build check box is checked for the Test Project (as my google search has revealed was the problem for others with this issue). I have set Test Project as my start up project for the solution. When I try to start the test I get "Can not start test project because the project does not contain any tests". I am really new to unit testing. What am I missing?

    Read the article

  • Unit testing task queues in AppEngine

    - by Swizec Teller
    For a very long time now I've been using task queues on AppEngine to schedule tasks, just the way I'm supposed to. But what I've always been wondering is how does one write tests for that? Until now I've simply made tests to make sure an error doesn't occur on the API that queues a task and then wrote the more proper tests for the API executing the task. However lately I've started feeling a bit unsatisfied by this and I'm searching for a way to actually test that the correct task has been added to the correct queue. Hopefully this can be done better than simply by deploying the code and hoping for the best. I'm using django-nonrel, if that has any bearing on the answer. To recap: How can a unit test be written to confirm tasks have been queued?

    Read the article

  • Unit testing nested subflows (subflows of subflows)

    - by snusmumrik
    I'm trying to write unit test for a flow, which has subflow, which, itself, has another subflow. I register first flow using FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory). Then I register subflow definitions during test execution in FlowDefinitionRegistry before transitioning to them. Transitioning to "first level" subflow goes ok. The result of transitioning to subflow of current subflow - NoSuchFlowDefinitionException. The problem is that subflow definitions are all seem attached to the primary flow of the test and subflow can't be found within another subflow. Is there any way to attach subflow definition to another subflow in tests, which extend AbstractXmlFlowExecutionTests?

    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

  • Unit testing with Data Access Layer

    - by chobo
    Hi, what is a good way to write unit tests with a LINQ to SQL DAL? Currently I am doing some database testing and need to create helper methods that access the database, but I don't want those methods in my main repo's. So what I have is two copies of the DAL, one in my main project and one in the Test project. Is it easier to manage these things if I create a separate project for the data layer? I'm not sure which way is a better way to approach this. If I do create a data layer project would I move all my repo's to that project as well? I'm not sure how to properly setup the layers. Thanks

    Read the article

  • Unit testing a functions whose purposes is side effects

    - by David
    How would you unit test do_int_to_string_conversion? #include <string> #include <iostream> void do_int_to_string_conversion(int i, std::string& s) { switch(i) { case 1: s="1"; break; case 2: s="2"; break; default: s ="Nix"; } std::cout << s << "\n"; } int main(int argc, char** argv){ std::string little_s; do_int_to_string_conversion(1, little_s); do_int_to_string_conversion(2, little_s); do_int_to_string_conversion(3, little_s); }

    Read the article

  • ASP.NET MVC 2 RTM Unit Tests not compiling

    - by nmarun
    I found something weird this time when it came to ASP.NET MVC 2 release. A very handful of people ‘made noise’ about the release.. at least on the asp.net blog site, usually there’s a big ‘WOOHAA… <something> is released’, kind of a thing. Hmm… but here’s the reason I’m writing this post. I’m not sure how many of you read the release notes before downloading the version.. I did, I did, I did. Now there’s a ‘Known issues’ section in the document and I’m quoting the text as is from this section: Unit test project does not contain reference to ASP.NET MVC 2 project: If the Solution Explorer window is hidden in Visual Studio, when you create a new ASP.NET MVC 2 Web application project and you select the option Yes, create a unit test project in the Create Unit Test Project dialog box, the unit test project is created but does not have a reference to the associated ASP.NET MVC 2 project. When you build the solution, Visual Studio will display compilation errors and the unit tests will not run. There are two workarounds. The first workaround is to make sure that the Solution Explorer is displayed when you create a new ASP.NET MVC 2 Web application project. If you prefer to keep Solution Explorer hidden, the second workaround is to manually add a project reference from the unit test project to the ASP.NET MVC 2 project. This definitely looks like a bug to me and see below for a visual: At the top right corner you’ll see that the Solution Explorer is set to auto hide and there’s no reference for the TestMvc2 project and that is the reason we get compilation errors without even writing a single line of code. So thanks to <VeryBigFont>ME</VeryBigFont> and <VerySmallFont>Microsoft</VerySmallFont>) , we’ve shown the world how to resolve a major issue and to live in Peace with the rest of humanity!

    Read the article

  • The art of Unit Testing with Examples in .NET

    - by outcoldman
    First time when I familiarized with unit testing was 5 or 6 years ago. It was start of my developing career. I remember that somebody told me about code coverage. At that time I didn’t write any Unit tests. Guy, who was my team lead, told me “Do you see operator if with three conditions? You should check all of these conditions”. So, after that I had written some code, I should go to interface and try to invoke all code which I wrote from user interface. Nice? At current time I know little more about tests and unit testing. I have not participated in projects, designed by Test Driven Development (TDD). Basics of my knowledge are a spying code of my colleagues, some articles and screencasts. I had decide that I should know much more, and became a real professional of unit testing, this is why I had start to read book The art of Unit Testing with Examples in .NET. More than, in my current job place looks like I’m just one who writing unit tests for my code. I should show good examples of my tests. ,a href="http://outcoldman.ru/en/blog/show/267"Read more...

    Read the article

  • Studies of Pair Programming on Translation Projects

    - by gmletzkojr
    I am looking for information (ie, studies, metrics, etc) for pair programming when translating a project from an "older" language to a "newer" language. In this particular case, translating means line for line translation where ever possible, and only modifying the design when absolutely necessary, not when the modification would provide improved performance. I have performed pair programming in new development, and I am well aware of the pros and cons of pairing in that environment. However, I haven't been able to find any information in this particular case. Any help is appreciated.

    Read the article

  • English to French translation of computing terminology

    - by Rich
    I work in France as a Java programmer, mainly in French, but am a native English speaker. My level of French is pretty good (French wife!), but one thing I have problems with is working out whether to use English terminology or a French equivalent. Examples: lock (as in a synchronisation lock) - do I use the verb "locker" or do I use verrouiller? shard (databases) - "un shard" or "un tesson" (which means a shard of glass) ...and so-on... So, what do people recommend? Can anyone point out some good websites for translating this kind of terminology? The usual online translation tools are a bit too everyday English/French, not the slightly more specialised version that I find myself needing.

    Read the article

  • Correct Rotation and Translation with a 4x4 matrix

    - by sFuller
    I am using a 4x4 matrix to transform verts in a shader. I multiply an identity matrix by a rotation matrix by a translation matrix. I am trying to first rotate the verts and then translate them, however in my result, it appears that the verts are being transformed and then rotated. My matrix looks something like this: m00 m01 m02 tx m10 m11 m12 ty m20 m21 m22 tz --- --- --- 1 I am not using OpenGL's fixed function pipeline, I am multiplying matrices on the client side, and uploading the matrix to a GLSL shader. If it helps, I am using my own matrix multiplication code, but I have recreated this problem using matrices on my graphing calculator, so I don't believe my matrix code has errors.. I'll include a visual aid if needed.

    Read the article

  • Interactive Reporting Translation Workbench utility is available

    - by THE
    As you may have seen in our  Newsletter, Oracle has released the "Oracle Hyperion Interactive Reporting Translation Workbench" for Hyperion Interactive Reporting (IR) customers who are moving to Oracle Business Intelligence Enterprise Edition (OBIEE). A summary for this utility can be found  here. To get the Utility along with documentation and training material we suggest that you visit the Oracle Technology Network ( OTN ) "Oracle Hyperion Interactive Reporting Downloads" page. Friendly enough, instead of hundreds of pages of "getting started Docs", Oracle has packed some training videos into the downloads, so that getting started is made as easy as possible. But of course the documentation comes with it as well.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >