UIZE JavaScript Framework

MODULES Uize.Test.Class.mModels

1. Introduction

The Uize.Test.Class.mModels module provides convenience methods for writing test cases against Uize.Class subclass modules that mix-in Uize.Class.mModels.

DEVELOPERS: Ben Ilegbodu, original code contributed by Zazzle Inc.

1.1. Examples

There are no dedicated showcase example pages for the Uize.Test.Class.mModels module.

SEARCH FOR EXAMPLES

Use the link below to search for example pages on the UIZE Web site that reference the Uize.Test.Class.mModels module...

SEARCH

1.2. Implementation Info

The Uize.Test.Class.mModels module defines the Uize.Test.Class.mModels object under the Uize.Test.Class namespace.

1.2.1. Features Introduced in This Module

The features listed in this section have been introduced in this module.

STATIC PROPERTIES

Uize.Test.Class.mModels.moduleName | Uize.Test.Class.mModels.pathToResources

1.2.2. Features Overridden in This Module

No features have been overridden in this module.

1.2.3. Features Inherited From Other Modules

This module has no inherited features.

1.2.4. Modules Directly Under This Namespace

There are no modules directly under this namespace.

1.2.5. Unit Tests

There is no dedicated unit tests module for the Uize.Test.Class.mModels module.

2. Static Methods

2.1. Uize.Test.Class.mModels.declarativeModelTest

.

SYNTAX

testCLASS = Uize.Test.Class.mModels.declarativeModelTest (
  paramsOBJ
);

2.1.1. paramsOBJ

.

2.1.1.1. childName

.

2.1.1.2. cases

.

2.1.1.2.1. modelClassName

.

2.1.1.2.2. expectedProperties

.

2.1.1.2.3. instanceProperties

.

NOTES

Omitting casesArray signals that the child actually should not be added

2.1.1.3. instanceProperties

.

2.1.1.4. testProperties

.

EXAMPLE

Uize.Test.Class.mModels.declarativeModelTest (
  {
    childName:'images',
    cases:[
      [
        modelClassName:'Uize.Models.Images',
        expectedProperties:{numImages:15},
        instanceProperties:{numImagesForImagesModel:15}
      ],
      [
        modelClassName:'Uize.Models.Images',
        expectedProperties:{numImages:100},
        instanceProperties:{numImagesForImagesModel:-1}
      ]
    ]
  }
);

NOTES

see the related Uize.Test.Class.mModels.declarativeModelsTest static method

2.2. Uize.Test.Class.mModels.declarativeModelsTest

.

SYNTAX

testCLASS = Uize.Test.Class.mModels.declarativeModelsTest (
  declarativeModelsTestsARRAYorOBJ
);

2.2.1. declarativeModelsTestsARRAYorOBJ

See Uize.Test.Class.mModels.declarativeModelTest static method for the structure for each set of declarative children tests.

EXAMPLE

Uize.Test.Class.mModels.declarativeModelsTest  (
  [
    {
      childName:'images',
      cases:[
      ]
    },
    {
      childName:'flowers',
      cases:[
      ]
    },
    {
      childName:'snakes'
    }
  ]
);

NOTES

see the related Uize.Test.Class.mModels.declarativeModelTest static method

2.3. Uize.Test.Class.mModels.modelBindingTest

.

SYNTAX

testCLASS = Uize.Test.Class.mModels.modelBindingTest (
  paramsOBJ
);

2.3.1. paramsOBJ

.

2.3.1.1. propertyName

.

2.3.1.2. cases

.

2.3.1.2.1. child

name of the bound child

2.3.1.2.2. property

child state property name

2.3.1.2.3. direction

binding direction

2.3.1.2.4. expect

array of expectations

2.3.1.2.5. instanceProperties

instance properties for the case

2.3.1.3. instanceProperties

.

2.3.1.4. testProperties

.

EXAMPLE

Uize.Test.Class.mModels.modelBindingTest (
  {
    propertyName:'numColors',
    cases:[
      {
        child:'images',
        property:'value',
        direction:'<->',
        expect:[
          {a:7, b:7}
        ]
      }
    ]
  }
);

NOTES

see the related Uize.Test.Class.mModels.childBindingsTest static method

2.4. Uize.Test.Class.mModels.modelBindingsTest

.

SYNTAX

testCLASS = Uize.Test.Class.mModels.modelBindingsTest (
  modelBindingsTestsARRAYorOBJ
);

2.4.1. modelBindingsTestsARRAYorOBJ

See Uize.Test.Class.mModels.modelBindingTest static method for the structure for each set of child binding tests.

EXAMPLE

Uize.Test.Class.mModels.modelBindingsTest  (
  [
    {
      propertyName:'numColors',
      cases:[
      ]
    },
    {
      propertyName:'maxValidColors',
      cases:[
      ]
    },
    {
      propertyName:'maxColors',
      cases:[
      ]
    }
  ]
);

NOTES

see the related Uize.Test.Class.mModels.modelBindingTest static method

3. Static Properties

3.1. Uize.Test.Class.mModels.moduleName

IMPLEMENTATION INFO

this feature was introduced in this module

3.2. Uize.Test.Class.mModels.pathToResources

IMPLEMENTATION INFO

this feature was introduced in this module