This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| // Value Object : Money | |
| public class Money { | |
| public double Value {get;set;} | |
| public string Currency {get;set;} | |
| public string Text { | |
| get { | |
| return String.Format("{0} {1}", this.Currency, this.Value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| "roots": [ | |
| "./src" | |
| ], | |
| "testMatch": [ | |
| "**/__tests__/**/*.+(ts|tsx|js)", | |
| "**/?(*.)+(spec|test).+(ts|tsx|js)" | |
| ], | |
| "transform": { | |
| "^.+\\.(ts|tsx)$": "ts-jest", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| module.exports = { | |
| process(src, filename, config, options) { | |
| return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';'; | |
| }, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ./tests/SmartLibrary.UnitTests | |
| dotnet test /p:CollectCoverage=true ^ | |
| /p:CoverletOutputFormat=cobertura ^ | |
| /p:CoverletOutput=./../../test_results/UnitTests/ ^ | |
| /p:Exclude="[xunit.*]* | |
| cd ./../../ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class Invoice | |
| { | |
| protected Motorcycle Motor {get;} | |
| protected Duration TrackDuration {get;} | |
| public Invoice(Motorcycle motor, Duration duration) | |
| { | |
| this.Motor = motor; | |
| this.TrackDuration = duration; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MogeInvoice : Invoice | |
| { | |
| public MogeInvoice(Motorcycle motor, Duration duration) : base(Motorcycle motor, Duration duration) | |
| { | |
| } | |
| public override Double CalculateInvoice() | |
| { | |
| // perhitungan invoice Moge | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Invoice | |
| { | |
| public Double CalculateInvoice(Motorcycle motor, Duration duration) | |
| { | |
| // perhitungan tagihan tracking motor pribadi | |
| } | |
| public void PayInvoice(double invoice) | |
| { | |
| // pembayaran struk tagihan | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Invoice | |
| { | |
| public Double CalculateInvoice(Motorcycle motor, Duration duration) | |
| { | |
| if(motor.type = "rent") | |
| { | |
| // perhitungan tagihan tracking motor sewaan | |
| } | |
| else if(motor.type = "loan") | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Motorcycle | |
| { | |
| public string ProductName {get;set;} | |
| public double Price {get;set;} | |
| public void Buy(PublicUser user) | |
| { | |
| // beli | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class UnreleasedMotorcycle | |
| { | |
| public string ProductName {get;set;} | |
| public Date ReleasedDate {get;set;} | |
| } | |
| public class AbgooMotor : UnreleasedMotorcycle | |
| { | |
| //... | |
| } |