|
|
@ -47,12 +47,16 @@ public abstract class EntityCache_Tests<TStartupModule> : TestAppTestBase<TStart |
|
|
{ |
|
|
{ |
|
|
var product = await ProductEntityCache.FindAsync(TestDataBuilder.ProductId); |
|
|
var product = await ProductEntityCache.FindAsync(TestDataBuilder.ProductId); |
|
|
product.ShouldNotBeNull(); |
|
|
product.ShouldNotBeNull(); |
|
|
|
|
|
product = await ProductEntityCache.FindAsync(TestDataBuilder.ProductId); |
|
|
|
|
|
product.ShouldNotBeNull(); |
|
|
product.Id.ShouldBe(TestDataBuilder.ProductId); |
|
|
product.Id.ShouldBe(TestDataBuilder.ProductId); |
|
|
product.Name.ShouldBe("Product1"); |
|
|
product.Name.ShouldBe("Product1"); |
|
|
product.Price.ShouldBe(decimal.One); |
|
|
product.Price.ShouldBe(decimal.One); |
|
|
|
|
|
|
|
|
var productCacheItem = await ProductCacheItem.FindAsync(product.Id); |
|
|
var productCacheItem = await ProductCacheItem.FindAsync(product.Id); |
|
|
productCacheItem.ShouldNotBeNull(); |
|
|
productCacheItem.ShouldNotBeNull(); |
|
|
|
|
|
productCacheItem = await ProductCacheItem.FindAsync(product.Id); |
|
|
|
|
|
productCacheItem.ShouldNotBeNull(); |
|
|
productCacheItem.Id.ShouldBe(TestDataBuilder.ProductId); |
|
|
productCacheItem.Id.ShouldBe(TestDataBuilder.ProductId); |
|
|
productCacheItem.Name.ShouldBe("Product1"); |
|
|
productCacheItem.Name.ShouldBe("Product1"); |
|
|
productCacheItem.Price.ShouldBe(decimal.One); |
|
|
productCacheItem.Price.ShouldBe(decimal.One); |
|
|
@ -95,6 +99,11 @@ public abstract class EntityCache_Tests<TStartupModule> : TestAppTestBase<TStart |
|
|
[Serializable] |
|
|
[Serializable] |
|
|
public class Product : FullAuditedAggregateRoot<Guid> |
|
|
public class Product : FullAuditedAggregateRoot<Guid> |
|
|
{ |
|
|
{ |
|
|
|
|
|
public Product() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public Product(Guid id, string name, decimal price) |
|
|
public Product(Guid id, string name, decimal price) |
|
|
: base(id) |
|
|
: base(id) |
|
|
{ |
|
|
{ |
|
|
@ -102,9 +111,6 @@ public class Product : FullAuditedAggregateRoot<Guid> |
|
|
Price = price; |
|
|
Price = price; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[JsonInclude] |
|
|
|
|
|
public override Guid Id { get; protected set; } |
|
|
|
|
|
|
|
|
|
|
|
public string Name { get; set; } |
|
|
public string Name { get; set; } |
|
|
|
|
|
|
|
|
public decimal Price { get; set; } |
|
|
public decimal Price { get; set; } |
|
|
|