This file contains 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
<?php | |
interface Customer { | |
public function getEarnedDiscount(): float; | |
public function addToOrdersHistory(Order $order): void; | |
} | |
// Null Customer's implementation | |
class NotFoundCustomer implements Customer { |
This file contains 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 interface Customer | |
{ | |
double GetEarnedDiscount(); | |
void AddToOrdersHistory(Order order); | |
} | |
// Null Customer's implementation | |
public class NotFoundCustomer : Customer | |
{ |
This file contains 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 interface Customer { | |
double getEarnedDiscount(); | |
void addToOrdersHistory(Order order); | |
} | |
// Null Customer's implementation | |
public class NotFoundCustomer implements Customer { | |
private final double DEFAULT_DISCOUNT = 1.0; |
This file contains 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 Coordinates { | |
public int x; | |
public int y; | |
public Coordinates(int x, int y) { | |
this.x = x; | |
this.y = y; | |
} | |
} |
This file contains 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 PageSEO { | |
Page calculate(Page current, Search search) { | |
// ... | |
} | |
} |
This file contains 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 interface IndexationCalculator { | |
Page update(Page current, Search search); | |
} | |
public interface CanonicalCalculator { | |
Page update(Page current, Search search); | |
} | |
public class Page { | |
public bool isIndexed; |
This file contains 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 NUnit.Framework; | |
namespace Gilded_rose.Test; | |
public class GildRoseTest | |
{ | |
private const int MinQuality = 0; | |
private const int MaxQuality = 50; | |
[Test] |
This file contains 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 NUnit.Framework; | |
using static ArgentRose.Tests.ArgentRoseStoreForTesting; | |
namespace ArgentRose.Tests; | |
public class ArgentRoseStoreTest | |
{ | |
private const int MinQuality = 0; | |
private const int MaxQuality = 50; | |
private const int SellInLastDay = 0; |
This file contains 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 NUnit.Framework; | |
using static ArgentRose.Tests.ArgentRoseStoreForTesting; | |
namespace ArgentRose.Tests; | |
public class ArgentRoseStoreTest | |
{ | |
[Test] | |
public void Regular_Product_Decreases_Quality_By_Two() | |
{ |
NewerOlder