コード例 #1
0
        public async Task CreateAssetGroup()
        {
            AssetGroupDTO createdGroup = await this.CreateTestAssetGroup();

            Assert.NotNull(createdGroup);

            AssetGroupEntity entity = await this.AssetGroupsManager.TryGetAsync(createdGroup.Name) as AssetGroupEntity;

            entity.ShouldBeEquivalentTo(createdGroup, o => o
                                        .ExcludingMissingMembers());
        }
コード例 #2
0
        public async Task UpdateAssetGroup()
        {
            string url = ApiPaths.ASSET_GROUPS_PATH;

            AssetGroupDTO TestAssetGroupUpdate = await CreateTestAssetGroup();

            AssetGroupDTO editGroup = new AssetGroupDTO()
            {
                Name        = TestAssetGroupUpdate.Name,
                IsIosDevice = !TestAssetGroupUpdate.IsIosDevice,
                ClientsCanCashInViaBankCards = TestAssetGroupUpdate.ClientsCanCashInViaBankCards,
                SwiftDepositEnabled          = TestAssetGroupUpdate.SwiftDepositEnabled
            };
            string editParam = JsonUtils.SerializeObject(editGroup);

            var response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, editParam, Method.PUT);

            Assert.True(response.Status == HttpStatusCode.NoContent);

            AssetGroupEntity entity = await this.AssetGroupsManager.TryGetAsync(editGroup.Name) as AssetGroupEntity;

            entity.ShouldBeEquivalentTo(editGroup, o => o
                                        .ExcludingMissingMembers());
        }