19 lines
614 B
TypeScript
19 lines
614 B
TypeScript
import assert from "node:assert/strict";
|
|
import { describe, it } from "node:test";
|
|
import {
|
|
calculateCircuitTotalPower,
|
|
calculateRowTotalPower,
|
|
} from "../src/domain/calculations/circuit-power-calculation.js";
|
|
|
|
describe("circuit power calculation", () => {
|
|
it("calculates row and circuit totals from device rows", () => {
|
|
assert.equal(calculateRowTotalPower(2, 1.5, 0.5), 1.5);
|
|
const total = calculateCircuitTotalPower([
|
|
{ quantity: 2, powerPerUnit: 1.5, simultaneityFactor: 0.5 },
|
|
{ quantity: 1, powerPerUnit: 3, simultaneityFactor: 1 },
|
|
]);
|
|
assert.equal(total, 4.5);
|
|
});
|
|
});
|
|
|