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
Budget { | |
public double CalculateTotal() { ... } | |
} | |
/* ---- */ | |
OneClient { | |
... | |
budget.CalculateTotal(); | |
... | |
} |
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
<?php | |
namespace tests; | |
use Codesai\TDD\GildedRose\GildedRose; | |
use Codesai\TDD\GildedRose\Item; | |
use PHPUnit\Framework\TestCase; | |
class GildedRoseTest extends TestCase | |
{ |
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 Xunit; | |
namespace Gilded_rose.Test | |
{ | |
public class GildedRoseTest | |
{ | |
private const int MinQuality = 0; | |
private const int MaxQuality = 50; | |
[Fact] |
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
import Shop from "./Shop"; | |
import Item from "./Item"; | |
const MIN_QUALITY = 0; | |
const MAX_QUALITY = 50; | |
test("regular items' quality decreases every day", () => { | |
const item = regularItem(1, 3); | |
const shop = new Shop([item]); |
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
import {Shop} from '../src/Shop'; | |
import {Item} from "../src/Item"; | |
describe('Gilded Rose', () => { | |
const MIN_QUALITY = 0; | |
const MAX_QUALITY = 50; | |
it("regular items' quality decreases every day", () => { | |
const item = regularItem(1, 3); |
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 PageIndexer { | |
PageIndexation calculate(PageIndexation currentPageIndexation, Search search) { | |
... | |
} | |
} |
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 interface IndexationCalculator { | |
PageIndexation update(PageIndexation currentPageIndexation, Search search); | |
} | |
public interface CanonicalCalculator { | |
PageIndexation update(PageIndexation currentPageIndexation, Search search); | |
} | |
public class PageIndexation{ | |
public bool isIndexed; |
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
package com.gildedrose; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
public class GildedRoseTest { | |
private static final int MIN_QUALITY = 0; |
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
CREATE OR REPLACE PACKAGE test_update_quality | |
IS | |
--%suite(Update quality) | |
--%beforeeach | |
PROCEDURE setup; | |
--%test(sell in decreases every day) | |
PROCEDURE sell_in_decreases_every_day; |
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
Exchange bank= new Exchange(). | |
bank.addRate("USD", "GBP", STANDARD_RATE); | |
bank.commission(STANDARD_COMMISSION); | |
Money result= bank.convert(new Note(100, "USD"), "GBP"); | |
assertEquals(new Note(49.25, "GBP"), result); | |
----- | |
Exchange bank= new Exchange(). | |
bank.addRate("USD", "GBP", 2); |