Skip to content

Commit

Permalink
test(product): add spec stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
gregswindle committed Jul 8, 2019
1 parent 4aaf4dc commit c6a3b82
Show file tree
Hide file tree
Showing 57 changed files with 3,641 additions and 662 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ _Table 1.1_
| [ISO 2108][iso-2108-url] | International Standard Book Number (ISBN) |
| [ISO 10957][iso-10957-url] | International Standard Music Number (ISMN) |

### 1.2. **@archetypes/product** Model
### 1.2. **@archetypes/product** Specification

[See the API section]() for model summaries.
_Figure 1: **@archetypes/product** module UML class diagram._ [^1]

![@archetypes/product module UML class diagram][archetypes-products-specification]

## 2. Installation

Expand Down Expand Up @@ -263,6 +265,10 @@ Before submitting a Pull Request, please read our:
<small>[![Back to Table of contents][octicon-triangle-up]
\[toc\]][toc-anchor]</small>

## 8. Citations and References

[^1]: Arlow, J., & Neustadt, I. (2004). _Enterprise Patterns and MDA_ (p. 205). Boston: Addison-Wesley.

<!-- ⛔️ Do not remove this line or anything under it. ⛔️ -->

<!-- Link and image refs -->
Expand All @@ -271,7 +277,7 @@ Before submitting a Pull Request, please read our:

[appveyor-url]: https://ci.appveyor.com/project/gregswindle/archetypes-products

[archetypes-products-overview]: ./docs/assets/archetypes.rules-overview.png
[archetypes-products-specification]: ./docs/assets/archetypes-product-module-specification.png

[codacy-coverage-image]: https://img.shields.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions lib/mixin-effective-dates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const ow = require('ow')

const mixinEffectiveDates = (object) => {
/* eslint-disable accessor-pairs */
Object.defineProperties(object, {
validFrom: {
enumerable: true,
get () {
return this.validFromValue
},
set (val = null) {
ow(val, ow.any(ow.date, ow.null))
this.validFromValue = val
}
},
validFromValue: {
value: null
},
validTo: {
enumerable: true,
get () {
return this.validToValue
},
set (val = null) {
ow(val, ow.any(ow.date, ow.null))
this.validToValue = val
}
},
validToValue: {
value: null
}
})
/* eslint-enable accessor-pairs */
}

module.exports = mixinEffectiveDates
7 changes: 7 additions & 0 deletions lib/product/__tests__/arbitrary-price.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ArbitraryPrice = require('../arbitrary-price.js');

describe('ArbitraryPrice', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/batch.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Batch = require('../batch.js');

describe('Batch', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/catalog-entry.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const CatalogEntry = require('../catalog-entry.js');

describe('CatalogEntry', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/measured-product-instance.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const MeasuredProductInstance = require('../measured-product-instance.js');

describe('MeasuredProductInstance', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/measured-product-type.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const MeasuredProductType = require('../measured-product-type.js');

describe('MeasuredProductType', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/package-instance.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const PackageInstance = require('../package-instance.js');

describe('PackageInstance', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/package-type.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const PackageType = require('../package-type.js');

describe('PackageType', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/package.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Package = require('../package.js');

describe('Package', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/price-options.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const PriceOptions = require('../price-options.js');

describe('PriceOptions', () => {
it('has a test', () => {

});
});
38 changes: 38 additions & 0 deletions lib/product/__tests__/price.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const Price = require('../price.js');

describe('Price', () => {
let price = null

afterEach(() => {
price = null
})

describe('represents the amount of money that must be paid in order to purchase a good or service', () => {

describe('amount', () => {
it('is monetary value', () => {
price = new Price(9.98)
expect(price.amount).toBe(9.98)

const DEFAULT_AMOUNT = 0
price = new Price()
expect(price.amount).toBe(DEFAULT_AMOUNT)
})

describe('when assigned a value other than a number', () => {
it('throws an ArgumentError', () => {
expect(() => {
price = new Price('free!')
}).toThrow()

expect(() => {
price = new Price(null)
}).toThrow()
})
})

})

})

});
7 changes: 7 additions & 0 deletions lib/product/__tests__/pricing-strategy.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const PricingStrategy = require('../pricing-strategy.js');

describe('PricingStrategy', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-catalog.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductCatalog = require('../product-catalog.js');

describe('ProductCatalog', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-feature-instance.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductFeatureInstance = require('../product-feature-instance.js');

describe('ProductFeatureInstance', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-feature-type.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductFeatureType = require('../product-feature-type.js');

describe('ProductFeatureType', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-identifier.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductIdentifier = require('../product-identifier.js');

describe('ProductIdentifier', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-instance.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductInstance = require('../product-instance.js');

describe('ProductInstance', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-relationship.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductRelationship = require('../product-relationship.js');

describe('ProductRelationship', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-set.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductSet = require('../product-set.js');

describe('ProductSet', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product-type.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ProductType = require('../product-type.js');

describe('ProductType', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/product.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Product = require('../product.js');

describe('Product', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/proposition-of-inclusion.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const PropositionOfInclusion = require('../proposition-of-inclusion.js');

describe('PropositionOfInclusion', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/serial-number.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const SerialNumber = require('../serial-number.js');

describe('SerialNumber', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/service-delivery-status.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ServiceDeliveryStatus = require('../service-delivery-status.js');

describe('ServiceDeliveryStatus', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/service-instance.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ServiceInstance = require('../service-instance.js');

describe('ServiceInstance', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/service-type.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const ServiceType = require('../service-type.js');

describe('ServiceType', () => {
it('has a test', () => {

});
});
7 changes: 7 additions & 0 deletions lib/product/__tests__/service.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Service = require('../service.js');

describe('Service', () => {
it('has a test', () => {

});
});
17 changes: 17 additions & 0 deletions lib/product/arbitrary-price.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Price = require('./price')

/**
* @classdesc
* Represents an ad hoc Price applied to a specific ProductInstance.
*
* • Rules-based pricing: a walk-through of a pricing process that is driven
* by business rules
* • Package pricing: how to represent the Price of a package
*
* @class ArbitraryPrice
* @extends {Price}
*/

class ArbitraryPrice extends Price {}

module.exports = ArbitraryPrice
5 changes: 5 additions & 0 deletions lib/product/batch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Batch {

}

module.exports = Batch
5 changes: 5 additions & 0 deletions lib/product/catalog-entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class CatalogEntry {

}

module.exports = CatalogEntry
5 changes: 5 additions & 0 deletions lib/product/measured-product-instance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class MeasuredProductInstance {

}

module.exports = MeasuredProductInstance
5 changes: 5 additions & 0 deletions lib/product/measured-product-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class MeasuredProductType {

}

module.exports = MeasuredProductType
5 changes: 5 additions & 0 deletions lib/product/package-instance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class PackageInstance {

}

module.exports = PackageInstance
5 changes: 5 additions & 0 deletions lib/product/package-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class PackageType {

}

module.exports = PackageType
5 changes: 5 additions & 0 deletions lib/product/package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Package {

}

module.exports = Package
9 changes: 9 additions & 0 deletions lib/product/price-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const mixinEffectiveDates = require('../mixin-effective-dates')

const priceOptions = {
'preconditions': null
}

mixinEffectiveDates(priceOptions)

module.exports = priceOptions
Loading

0 comments on commit c6a3b82

Please sign in to comment.