Base solution for your next web application
Open Closed

IPersonAppService causes Test failure #4954


User avatar
0
TimMackey created

When IPersonAppService interface is added, like this....

public class PersonAppService : PhoneBookDemoAppServiceBase, IPersonAppService

Tests Should_Get_All_People_Without_Any_Filter() and Should_Get_People_With_Filter() fail. When IPersonAppService is removed, the Tests pass. Also of note, the TenantId column in PbPersons and PbPhone is never set to 1. I also deleted and recreated the database to see if that would fix the problem. The Seed does create two new records on Host startup, but the TenantId is 0.

public partial class Implemented_IMustHaveTenant_For_Person : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "TenantId",
                table: "PbPersons",
                nullable: false,
                defaultValue: 1);
        }
        ...
    }

MultiTenancyEnabled state makes no difference.

public class PhoneBookDemoConsts
    {
        public const bool MultiTenancyEnabled = true;
        ...
    }

1 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    Hi,

    Checked and no problem found! Is there someone else fell into the same problem with @TimMackey?