Hi @aaron,
This is my test code:
public class CategoryAppService_Tests : AppTestBase
{
private readonly ICategoryAppService _categoryAppService;
public CategoryAppService_Tests()
{
_categoryAppService = Resolve<ICategoryAppService>();
}
[Fact]
public async Task Should_Get_All_Categories_Without_Any_Filter()
{
//Act
var categories = await _categoryAppService.GetCategories(new GetCategoriesInput());
//Assert
categories.Items.Count.ShouldBe(2);
}
}
This is my service code:
public class CategoryAppService : IpsAppServiceBase, ICategoryAppService
{
private readonly IRepository<Category> _categoryRepository;
public CategoryAppService(IRepository<Category> categoryRepository)
{
_categoryRepository = categoryRepository;
}
public async Task<ListResultDto<CategoryListDto>> GetCategories(GetCategoriesInput input)
{
var categories = await _categoryRepository
.GetAll()
.WhereIf(
!input.Filter.IsNullOrEmpty(),
c => c.Title.Contains(input.Filter) ||
c.Description.Contains(input.Filter)
)
.OrderBy(c => c.Title)
.ToListAsync();
return new ListResultDto<CategoryListDto>(categories.MapTo<List<CategoryListDto>>());
}
}
Hi support team,
I just follow the PhoneBookDemo sample to create an application service. Everything run well, except the test. I've tried several times, but cannot pass the test. Please, help me figure it out. The following is the error message.
Test Name: Ips.Tests.Common.CategoryAppService_Tests.Should_Get_All_Categories_Without_Any_Filter Test FullName: Ips.Tests.Common.CategoryAppService_Tests.Should_Get_All_Categories_Without_Any_Filter Test Source: C:\Git\Ips\aspnet-core\test\Ips.Tests\Common\CategoryAppService_Tests.cs : line 23 Test Outcome: Failed Test Duration: 0:00:00.001
Result StackTrace:
at Ips.Migrations.Seed.Host.DefaultSettingsCreator.Create() in C:\Git\Ips\aspnet-core\src\Ips.EntityFrameworkCore\Migrations\Seed\Host\DefaultSettingsCreator.cs:line 27
at Ips.Migrations.Seed.Host.InitialHostDbBuilder.Create() in C:\Git\Ips\aspnet-core\src\Ips.EntityFrameworkCore\Migrations\Seed\Host\InitialHostDbBuilder.cs:line 19
at Ips.Migrations.Seed.SeedHelper.SeedHostDb(IpsDbContext context) in C:\Git\Ips\aspnet-core\src\Ips.EntityFrameworkCore\Migrations\Seed\SeedHelper.cs:line 26
at Ips.Migrations.Seed.SeedHelper.WithDbContext[TDbContext](IIocResolver iocResolver, Action1 contextAction) in C:\Git\Ips\aspnet-core\src\Ips.EntityFrameworkCore\Migrations\Seed\SeedHelper.cs:line 42 at Ips.Migrations.Seed.SeedHelper.SeedHostDb(IIocResolver iocResolver) in C:\Git\Ips\aspnet-core\src\Ips.EntityFrameworkCore\Migrations\Seed\SeedHelper.cs:line 18 at Ips.EntityFrameworkCore.IpsEntityFrameworkCoreModule.PostInitialize() in C:\Git\Ips\aspnet-core\src\Ips.EntityFrameworkCore\EntityFrameworkCore\IpsEntityFrameworkCoreModule.cs:line 61 at System.Collections.Generic.List
1.ForEach(Action1 action) at Abp.AbpBootstrapper.Initialize() in D:\Github\aspnetboilerplate\src\Abp\AbpBootstrapper.cs:line 155 at Abp.TestBase.AbpIntegratedTestBase
1.InitializeAbp() in D:\Github\aspnetboilerplate\src\Abp.TestBase\TestBase\AbpIntegratedTestBase.cs:line 53
at Ips.Test.Base.AppTestBase`1..ctor() in C:\Git\Ips\aspnet-core\test\Ips.Test.Base\AppTestBase.cs:line 30
at Ips.Tests.AppTestBase..ctor()
at Ips.Tests.Common.CategoryAppService_Tests..ctor() in C:\Git\Ips\aspnet-core\test\Ips.Tests\Common\CategoryAppService_Tests.cs:line 17
Result Message: System.NullReferenceException : Object reference not set to an instance of an object.
Thank you very much
Hi @ismcagdas,
We don't want to write custom css. We just want to modify the current css classes for the header, footer and user's image icon. Is that possible? And could you show me where to modify these css classes to adjust the height?
Thank you.
Hi hikalkan,
We want to build such a MongoDB repository that can be integrated with aspnet zero. Can you show me the best approach to do this? It's hightly appreciated if you have any sample code for that.
Thank you very much.
Hello support team,
We are using the ASP.NET Core & Angular project. Could you please tell us how to adjust the height of the header, the footer and the image icon of the user in the upper-right corner of the header (theme 12).
Thank you in advance.
Dzung Le
Hello support team,
We're using MongoDB as the data store for one of our modules. We want to create some entities in the Domain layer ( .Core project). Is it possible that our entities can directly inherit from FullAuditedEntity?
Thank you very much.
Dzung Le
Hello friends,
We want to add some more properties to the OrganizationUnit entity and build some more business logics on this entity. But we are not sure how to do it correctly. Could you please show us the best practice to achieve this task? Thank you in advance.
Dzung Le
Thank you, my firends. We'll do some SQL server database tuning.
Hello Support team, We use ASPNET Zero (Angular + ASP.NET Core) as the base solution for our web application deployed in our LAN. It’s great that your base solution saved us a lot of time, but the performance (response time) is a litle bit slow. We think the cause might be of the Multi-Tenancy feature (even we turned it off). We don’t need this fearture in our application. So, do you have any other version of ASPNET Zero without the Multi-Tenancy feature? If you don’t have, we need to remove Multitennancy feature from the code base. Is it possible to do that? Could you please show us steps to achieved this task. Thank you very much. Best Regards, Le Dzung