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
[TestMethod] | |
public void It_uses_more_specific_rule_if_rule_and_information_is_present() | |
{ | |
Given(new ProductType("air", null, ProductCategory.AirOnly), | |
new ProductType("air", "someSpecialWeirdProduct", ProductCategory.LandOnly)) | |
.ItMaps(new ProductReference("air", "someSpecialWeirdProduct")) | |
.To(ProductCategory.LandOnly); | |
} |
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
protected override ValidationResults OnValidate(PurchaseTransaction purchaseTransaction) | |
{ | |
return purchaseTransaction | |
.With(ValidationCheck) | |
.Unless(IsValidateServiceDown) | |
.Try(SendMessageToTransecure) | |
.InCaseOfException(MarkServiceAsDown) | |
.Return(TheResult, OrFailureCodeInCaseOfFailure); | |
} |
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
[Test] | |
public void NHibernate_allows_crud_operations() | |
{ | |
Create(); | |
Read(); | |
Update(); | |
Delete(); | |
} | |
private void Create() |
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
//Customer is an aggregate root | |
public class Customer : AggregateRootMappedByConvention | |
{ | |
//Customer contains orders, each of which is uniquely identified hence is an entity | |
private readonly List<Order> _orders = new List<Order>(); | |
public void CreateOrder(int id) | |
{ | |
//Does not create an entity, only publishes event. | |
//The entity has localy unique id. Its uniqueness is ensured here. |
NewerOlder