Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Business Logic exercise, to make it more gradual and easier t…
…o fill gaps Now, there's a template where to put business logic without the need to modify unit tests
- Loading branch information
1 parent
7cb33aa
commit b82d7c6
Showing
39 changed files
with
1,253 additions
and
1,004 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
24 changes: 24 additions & 0 deletions
24
Workshops/IntroductionToEventSourcing/07-BusinessLogic/Immutable/PricingCalculator.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace IntroductionToEventSourcing.BusinessLogic.Immutable; | ||
|
||
public interface IProductPriceCalculator | ||
{ | ||
PricedProductItem Calculate(ProductItem productItems); | ||
} | ||
|
||
public class FakeProductPriceCalculator: IProductPriceCalculator | ||
{ | ||
private readonly int value; | ||
|
||
private FakeProductPriceCalculator(int value) | ||
{ | ||
this.value = value; | ||
} | ||
|
||
public static FakeProductPriceCalculator Returning(int value) => new(value); | ||
|
||
public PricedProductItem Calculate(ProductItem productItem) | ||
{ | ||
var (productId, quantity) = productItem; | ||
return new PricedProductItem(productId, quantity, value); | ||
} | ||
} |
Oops, something went wrong.