예제 #1
0
        public async Task CreateDictionary_Test()
        {
            //LoginAsTenant(Tenant.DefaultTenantName, "TestUser");
            //var adminUser = UsingDbContext(ctx => ctx.Users.FirstOrDefault(u => u.UserName == User.AdminUserName));

            await UsingDbContextAsync(async context =>
            {
                var intialCount = context.Dictionary.Count();
                var Dictionary  = await _dictionaryAppService.Create(
                    new CreateDictionaryDto
                {
                    DicName     = "字典测试",
                    Description = "字典测试描述",
                });
                var johnNashUser = await context.Dictionary.FirstOrDefaultAsync(u => u.Id == Dictionary.Id);
                context.Dictionary.Count().ShouldBe(intialCount + 1);
                johnNashUser.ShouldNotBeNull();
            });
        }
 public Task <DictionaryDto> Create(CreateOrUpdateDictionaryDto input)
 {
     return(_dictionaryAppService.Create(input));
 }