Skip to content

Commit

Permalink
Format code B.
Browse files Browse the repository at this point in the history
  • Loading branch information
codecop committed Dec 7, 2023
1 parent 8172c16 commit 49d019f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions TypeScript/app/b/Assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ run on our online shop. During campaigns we e.g. offer discounts.

* Bring `MarketingCampaign` under test. Make sure to cover all paths in the core logic.
* There is an existing `MarketingCampaignTest` with a first test case which might or might not work.

(This is a copied document - do not edit!)
6 changes: 3 additions & 3 deletions TypeScript/app/b/marketing-campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ export class MarketingCampaign {
}

public isCrazySalesDay(): boolean {
return this.dayOfWeek() == 5;
return this.dayOfWeek() == 5; // Friday
}

private milliseconds(): number {
let now: Date = new Date();
const now: Date = new Date();
return now.getMilliseconds();
}

private dayOfWeek(): number {
let date: Date = new Date();
const date: Date = new Date();
return date.getDay();
}
}
14 changes: 7 additions & 7 deletions TypeScript/test/b/marketing-campaign.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {MarketingCampaign} from "../../app/b/marketing-campaign";
import {expect} from "chai";
import { MarketingCampaign } from "../../app/b/marketing-campaign";
import { expect } from "chai";

describe('MarketingCampaign Test', () => {
describe('MarketingCampaign', () => {

it('test in b', () => {
let campaign = new MarketingCampaign();
it('test 2', () => {
const campaign = new MarketingCampaign();

let isCrazySalesDay: boolean = campaign.isCrazySalesDay();
const isCrazySalesDay: boolean = campaign.isCrazySalesDay();

expect(isCrazySalesDay).to.be.false;
});

});
});

0 comments on commit 49d019f

Please sign in to comment.