Browse Source

Fix unit tests

pull/14055/head
LiangShiWei 4 years ago
parent
commit
31e519087e
  1. 7
      framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DomainEvents/EntityCache_Tests.cs
  2. 6
      framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/TestApp/MemoryDb/TestAppMemoryDbContext.cs
  3. 2
      framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs
  4. 3
      framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityCache_Tests.cs

7
framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DomainEvents/EntityCache_Tests.cs

@ -0,0 +1,7 @@
using Volo.Abp.TestApp.Testing;
namespace Volo.Abp.MemoryDb.DomainEvents;
public class EntityCache_Tests : EntityCache_Tests<AbpMemoryDbTestModule>
{
}

6
framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/TestApp/MemoryDb/TestAppMemoryDbContext.cs

@ -2,6 +2,7 @@
using System.Collections.Generic;
using Volo.Abp.MemoryDb;
using Volo.Abp.TestApp.Domain;
using Volo.Abp.TestApp.Testing;
namespace Volo.Abp.TestApp.MemoryDb;
@ -9,8 +10,9 @@ public class TestAppMemoryDbContext : MemoryDbContext
{
private static readonly Type[] EntityTypeList = {
typeof(Person),
typeof(EntityWithIntPk)
};
typeof(EntityWithIntPk),
typeof(Product)
};
public override IReadOnlyList<Type> GetEntityTypes()
{

2
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs

@ -30,7 +30,7 @@ public class AbpMongoDbTestModule : AbpModule
context.Services.AddMongoDbContext<TestAppMongoDbContext>(options =>
{
options.AddDefaultRepositories<ITestAppMongoDbContext>(true);
options.AddDefaultRepositories<ITestAppMongoDbContext>();
options.AddRepository<City, CityRepository>();
options.ReplaceDbContext<IThirdDbContext>();

3
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityCache_Tests.cs

@ -3,6 +3,7 @@ using System.Text.Json.Serialization;
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Domain.Entities.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Modularity;
@ -91,7 +92,7 @@ public abstract class EntityCache_Tests<TStartupModule> : TestAppTestBase<TStart
}
[Serializable]
public class Product : Entity<Guid>
public class Product : FullAuditedAggregateRoot<Guid>
{
public Product(Guid id, string name, decimal price)
: base(id)

Loading…
Cancel
Save