Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ahoicloud/co2 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arnebr committed Feb 4, 2023
2 parents 7dfeeaf + c08905e commit 70131c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Co2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

expect($co2->energyPerByteByComponent(2257715.2))->toBeArray();
});
it("returns a CO2 number for data transfer", function () {
it('returns a CO2 number for data transfer', function () {
$co2 = new Co2();
expect(number_format($co2->perByte(MILLION), 5))->toBe(number_format(MILLION_GREY, 5));
});
Expand All @@ -49,19 +49,19 @@
expect(number_format($co2->perByte(MILLION, true), 5))->toBe(number_format(MILLION_GREEN, 5));
});

it("returns adjusted data center and total emissions for when green, other values remain the same as grey", function () {
it('returns adjusted data center and total emissions for when green, other values remain the same as grey', function () {
$co2 = new Co2();
$co2_result_segements=$co2->perByte(MILLION,true,true);
$co2_result_segements = $co2->perByte(MILLION, true, true);

expect(number_format($co2_result_segements['consumerDeviceCO2'], 5))->toBe(number_format(MILLION_GREY_DEVICES, 5));
expect(number_format($co2_result_segements['dataCenterCO2'], 6))->toBe(number_format(MILLION_GREEN_DATACENTERS, 6));
expect(number_format($co2_result_segements['total'], 5))->toBe(number_format(MILLION_GREEN, 5));
});

it("returns an object with devices, networks, data centers, and production emissions shown separately, as well as the total emissions", function () {
it('returns an object with devices, networks, data centers, and production emissions shown separately, as well as the total emissions', function () {
$co2 = new Co2();
$co2_result_segements=$co2->perByte(MILLION,false,true);
$co2_result_segements = $co2->perByte(MILLION, false, true);

expect(number_format($co2_result_segements['consumerDeviceCO2'], 5))->toBe(number_format(MILLION_GREY_DEVICES, 5));
expect(number_format($co2_result_segements['dataCenterCO2'], 5))->toBe(number_format(MILLION_GREY_DATACENTERS, 5));
expect(number_format($co2_result_segements['networkCO2'], 5))->toBe(number_format(MILLION_GREY_NETWORKS, 5));
Expand Down

0 comments on commit 70131c7

Please sign in to comment.