Search Results

Search found 9492 results on 380 pages for 'logic unit'.

Page 12/380 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How can you unit test a DelegateCommand

    - by Damian
    I am trying to unit test my ViewModel and my SaveItem(save, CanSave) delegate command. I want to ensure that CanSave is called and returns the correct value given certain conditions. Basically, how can I invoke the delegate command from my unit test, actually it's more of an integration test. Obviously I could just test the return value of the CanSave method but I am trying to use BDD to the letter, ie. no code without a test first.

    Read the article

  • CodeIgniter, Unit Testing, and Continuous Integration

    - by blork
    As part of a University project, my team and I have to set up automated unit testing with CruiseControl.rb. We chose to use CodeIgniter for the project, and are having some problems getting everything working together. Does anyone have experience setting up such a configuration? Some of the unit testing frameworks we've tried are: PHPUnit SimpleTest Toast ...but we've had no success with any of them.

    Read the article

  • Flex unit testing with ANT vs Flash Builder 4

    - by peterlindstrom21
    I have just tried setup unit testing in Flash Builder 4, and it working nicely. A setup of a parallel test source structure and using Flash Builder 4:s new TestCase and new TestSuite I was up and running with some testcases within minutes. But now I want to compile them from a ant flex task, the Flash Builder generates FlexUnitApplication.mxml and FlexUnitCompilerApplication.mxml. Is there a nice way to build the unit tests with ant using these? I cant find any sample where this is done.

    Read the article

  • Mock dll methods for unit tests

    - by sanjeev40084
    I am trying to write a unit test for a method, which has a call to method from dll. Is there anyway i can mock the dll methods so that i can unit test? public string GetName(dllobject, int id) { var eligibileEmp = dllobject.GetEligibleEmp(id); <---------trying to mock this method if(eligibleEmp.Equals(empValue) { .......... } }

    Read the article

  • Unit Testing and SharePoint Development

    - by MagicAndi
    Hi, I am interested in writing unit tests for the SharePoint development work I am doing. Can anyone suggest practical approachs to implementing unit tests in MOSS? Note that any third party tools have to be free (but not necessarily open-source); the company I work for will not pay for additional tooling. In particular, any alternatives to the Typemock Isolator for SharePoint would be appreciated. Thanks, MagicAndi.

    Read the article

  • Unit Testing - not testable code converted to testable code

    - by imak
    I have read so many places is that if your code is not test-able that mean code is not well written. So that makes me start writing a code that is test-able and to start using some unit testing framework. With this though I start looking for some example with piece of code that is not testable and gradually converted to a testable code. I find tons of examples on unit testing but if someone can provide an example like above it probably can jump start things for me. TIA

    Read the article

  • What is unit testing?

    - by Alon
    What is unit testing and unit testing libraries like xUnit? I understood it's testing specific code, so what's the difference between this and just opening a new project and test this specific code?

    Read the article

  • Attribute to skip over statement in unit test c#

    - by Eli Perpinyal
    I am looking to skip a certain statement in my unit tests eg: if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes) is there an attribute i can place above the statement to avoid the unit test executing it?

    Read the article

  • Unit test helper methods?

    - by Aly
    Hi, I have classes which prviously had massive methods so i subdivided the work of this method into 'helper' methods. These helper methods are declared private to enforce encapsulation - however I want to unit test the big public methods, is it good to unit test the helper methods too as if one of them fail the public method that calls it will also fail - but this way we can identify why it failed. Also in order to test these using a mock object I would need to change their visibility from private to protected, is this desirable?

    Read the article

  • Unit tests and fixtures

    - by Wizzard
    We have a bunch of unit tests which test a lot of webpages and REST API services. Currently when our tests run it pulls from these pages live but this can take ages to run sometimes, and it also feels like the tests should be testing more of our code - not just relying on them being up and responding (if that makes sense..). Is it better practice to save a valid api response and with the unit tests load this in during setup? Thoughts?

    Read the article

  • Unit testing DTS packages

    - by fede
    Hi, does anybody have any experience writing unit tests for sql server 2000 DTS packages? I about to start working with DTS and jobs, so I want to be able to unit test as much as possible. I guess i could invoke dtsrun.exe via command line , but perhaps someone else has better ideas. Thanks Fede

    Read the article

  • Unit Test Sessions Window Closes when debugging

    - by Daniel Dyson
    When I select an NUnit test in the Unit Test Sessions window and click debug, the window disappears. My breakpoints are hit, but if I hit F5, the Unit Test Sessions window does not return until the test returns a result or I stop the debugging session. This is preventing me from viewing any console output during tests. Any ideas?

    Read the article

  • Unit testing http handlers?

    - by MockedMan.Object
    My current project based in Asp .net makes considerable use of Http handlers to process various requests? So, is there any way by which I can test the functionality of each of the handlers using unit test cases? We are using Nunit and Moq framework to facilitate unit testing.

    Read the article

  • Do you write unit tests for all the time in TDD?

    - by mcaaltuntas
    I have been designing and developing code with TDD style for a long time. What disturbs me about TDD is writing tests for code that does not contain any business logic or interesting behaviour. I know TDD is a design activity more than testing but sometimes I feel it's useless to write tests in these scenarios. For example I have a simple scenario like "When user clicks check button, it should check file's validity". For this scenario I usually start writing tests for presenter/controller class like the one below. @Test public void when_user_clicks_check_it_should_check_selected_file_validity(){ MediaService service =mock(MediaService); View view =mock(View); when(view.getSelectedFile).thenReturns("c:\\Dir\\file.avi"); MediaController controller =new MediaController(service,view); controller.check(); verify(service).check("c:\\Dir\\file.avi"); } As you can see there is no design decision or interesting code to verify behaviour. I am testing values from view passed to MediaService. I usually write but don't like these kind of tests. What do yo do about these situations ? Do you write tests for all the time ? UPDATE : I have changed the test name and code after complaints. Some users said that you should write tests for the trivial cases like this so in the future someone might add interesting behaviour. But what about “Code for today, design for tomorrow.” ? If someone, including myself, adds more interesting code in the future the test can be created for it then. Why should I do it now for the trivial cases ?

    Read the article

  • Is application-specific data required for good unit testing?

    - by stinkycheeseman
    I am writing unit tests for a fairly simple function that depends on a fairly complicated set of data. Essentially, the object I am manipulating represents a graph and this function determines whether to chart a line, bar, or pie chart based on the data that came back from the server. This is a simplified version, using jQuery: setDefaultChartType: function (graphObject) { var prop1 = graphObject.properties.key; var numCols = 0; $.each(graphObject.columns, function (colIndex, column) { numCols++; }); if ( numCols > 6 || ( prop1 > 1 && graphObject.data.length == 1) ) { graphObject.setChartType("line"); } else if ( numCols <=6 && prop1 == 1 ) { graphObject.setChartType("bar"); } else if ( numCols <=6 && prop1 > 1 ) { graphObject.setChartType("pie"); } } My question is, should I use mock data that is procured from the actual database? Or can I just fabricate data that fits the different cases? I'm afraid that fabricating data will not expose bugs arising from changes in the database, but on the other hand, it would require a lot more effort to keep the test data up-to-date that I'm not sure is necessary.

    Read the article

  • How and what should I be (unit) testing for in this method?

    - by user460667
    I am relatively new to unit testing and have a query about what/how I should be testing a certain method. For the following (psudo-c#) method I have created (not a real-life example) what would you test for? Initially, my thoughts would be to test the output with variations on the dictionary of form fields, e.g. valid, invalid, missing values. However I also wonder how you would test to make sure the object values have been changed to the correct value and that the correct email message was attempted to be sent (obviously both services could/would be mocked). I hope what I am asking makes sense, I appreciate this is a subjective question and the answers may be 'it depends' ;) public bool ProcessInput(Dictionary<string, string> formFields, ObjService objService, EmailService emailService) { try { // Get my object id int objId; if(!int.TryParse(formField["objId"], out objId) { return false; } // Update my object - would you validate the save against a DB or a mocked inmemory db? var myObj = objService.Find(objId); myObj.Name = formField["objName"]; objService.Save(myObj); // Send an email - how would you test to make sure content, recipient, etc was correct? emailService.SendEmail(formField("email"), "Hello World"); return true; } catch(Exception ex) { return false; } }

    Read the article

  • Is XML a good logic to load data??

    - by Mat
    Hi stack, i'm working on an app that loads some data from xml file from internet. Is this a good way to develop iPhone apps??...I think xml is more light than SQlite database... Basically my logic is: 1 - Parsing Xml file from internet to retrive the data 2 - Load data on device Security?..other stuff??.. Thanks Mat

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >