• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mxunit
 

Mxunit

on

  • 647 views

 

Statistics

Views

Total Views
647
Views on SlideShare
644
Embed Views
3

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 3

https://www.linkedin.com 2
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Mxunit Mxunit Presentation Transcript

    • MXUnit Vikas Patel
    • Agenda
      • What is MXUnit?
      • Why MXUnit?
      • Installation
      • Anatomy of test cases
      • Directory runner & output formats
      • Data provider
      • Testing private methods
      • Built-in Assertions
    • What is MXUnit?
      • MXUnit is a unit testing framework for CFML developers, modeled after other xUnit frameworks (JUnit, etc)
    • Why MXUnit?
      • Why testing?
      • Convenience features like directory runner, easy debugging, eclipse plug-in, output formats etc.
      • Support by Google group
    • Installation
      • Download the latest version
      • Unzip to your webroot; e.g., C:Inetpubwwwroot
      • Test the installation e.g. http://localhost:8500/mxunit/
    • Anatomy of a TestCase
      • Create component (.cfc), filename either starts or ends with "Test“
      • component extends mxunit.framework.TestCase
      • The TestCase can contain setUp() and tearDown() functions that will run prior to and after each and every test
    • Anatomy of a TestCase (Cont.)
      • The TestCase can contain beforeTests() and afterTests() functions that will be run once before and once after all tests
      • Write public methods in which you can write your assertions
      • You can run the test by loading it in the browser and suffixing it with "?method=runTestRemote", like so: http://localhost/myapp/tests/MyTest.cfc?method=runTestRemote
    • TestCase: Example
    • Directory Runner: Example
      • Supported Output formats:
        • HTML (or extjs deprecated)
        • XML
        • Junitxml
        • Query
        • Array
    • Data Provider
      • Basic array data providor
      • Example
    • Data Provider (Cont.)
      • Query data provider
      • Basic list data provider
      • Basic Excel/CSV data provider
      • Basic iterator data provider
    • Testing Private Methods
    • Built-in Assertions
      • assertTrue(boolean condition [,String message])
      • assertFalse(boolean condition [, String message])
      • assert(boolean condition [,String message])
      • assertEquals(any expected, any actual [, String message])
    • Built-in Assertions (Cont.)
      • fail(String message)
      • failNotEquals(any value, any value2 [,String message])
      • assertSame(any obj1, any obj2 [,String message])
      • assertNotSame(any obj1, any obj2 [,String message])
    • Built-in Assertions (Cont.)
      • assertXPath(String xpath, any data, [String text], [String message])
      • assertIsTypeOf(component obj, String type)
      • assertIsXMLDoc(any xml [, String message])
      • assertIsArray(any obj1)
      • assertIsDefined(any obj1)
    • Built-in Assertions (Cont.)
      • assertIsEmpty(any obj1)
      • assertIsEmptyArray(any obj1,[String message])
      • assertIsEmptyQuery(any obj1,[String message])
      • assertIsEmptyStruct(any obj1,[String message])
      • assertIsQuery(any q)
      • assertIsStruct(any obj)
    • Thanks