Пример #1
0
        public async Task Add(EntityDynamicParameterValueDto input)
        {
            var entity = ObjectMapper.Map <EntityDynamicParameterValue>(input);

            entity.TenantId = AbpSession.TenantId;
            await _entityDynamicParameterValueManager.AddAsync(entity);
        }
        public async Task Should_Add_Parameter_Value_Async()
        {
            var entityDynamicParameter = CreateAndGetEntityDynamicParameter();
            var val = new EntityDynamicParameterValue()
            {
                EntityDynamicParameterId = entityDynamicParameter.Id,
                EntityId = "123",
                Value    = "TestValue",
                TenantId = AbpSession.TenantId
            };

            await RunAndCheckIfPermissionControlledAsync(() => _entityDynamicParameterValueManager.AddAsync(val));

            await WithUnitOfWorkAsync(async() =>
            {
                var val2 = await _entityDynamicParameterValueManager.GetAsync(val.Id);
                val.ShouldNotBeNull();
                val2.ShouldNotBeNull();

                val.EntityDynamicParameterId.ShouldBe(val2.EntityDynamicParameterId);
                val.EntityId.ShouldBe(val2.EntityId);
                val.Value.ShouldBe(val2.Value);
            });
        }