From 49d019f08998a17fb1735cae261d3655e36c625a Mon Sep 17 00:00:00 2001 From: Peter Kofler Date: Thu, 7 Dec 2023 16:12:27 +0100 Subject: [PATCH] Format code B. --- TypeScript/app/b/Assignment.md | 2 ++ TypeScript/app/b/marketing-campaign.ts | 6 +++--- TypeScript/test/b/marketing-campaign.test.ts | 14 +++++++------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/TypeScript/app/b/Assignment.md b/TypeScript/app/b/Assignment.md index 96f7346..8dbc645 100644 --- a/TypeScript/app/b/Assignment.md +++ b/TypeScript/app/b/Assignment.md @@ -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!) diff --git a/TypeScript/app/b/marketing-campaign.ts b/TypeScript/app/b/marketing-campaign.ts index b8aca32..d109a01 100644 --- a/TypeScript/app/b/marketing-campaign.ts +++ b/TypeScript/app/b/marketing-campaign.ts @@ -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(); } } diff --git a/TypeScript/test/b/marketing-campaign.test.ts b/TypeScript/test/b/marketing-campaign.test.ts index 7a7f3e5..99fe34c 100644 --- a/TypeScript/test/b/marketing-campaign.test.ts +++ b/TypeScript/test/b/marketing-campaign.test.ts @@ -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; }); -}); \ No newline at end of file +});