Пример #1
0
        public async Task UpdateAssetPair()
        {
            string url = ApiPaths.ASSET_PAIRS_PATH;

            AssetPairDTO TestAssetPairUpdate = await CreateTestAssetPair();

            AssetPairDTO updateAssetPair = new AssetPairDTO()
            {
                Accuracy         = Helpers.Random.Next(2, 8),
                BaseAssetId      = TestAssetPairUpdate.BaseAssetId,
                Id               = TestAssetPairUpdate.Id,
                InvertedAccuracy = TestAssetPairUpdate.InvertedAccuracy,
                IsDisabled       = TestAssetPairUpdate.IsDisabled,
                Name             = TestAssetPairUpdate.Name + Helpers.Random.Next(1000, 9999).ToString() + GlobalConstants.AutoTest,
                QuotingAssetId   = TestAssetPairUpdate.QuotingAssetId,
                Source           = TestAssetPairUpdate.Source,
                Source2          = TestAssetPairUpdate.Source2
            };
            string updateParam = JsonUtils.SerializeObject(updateAssetPair);

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

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

            AssetPairEntity entity = await this.AssetPairManager.TryGetAsync(updateAssetPair.Id) as AssetPairEntity;

            entity.ShouldBeEquivalentTo(updateAssetPair, o => o
                                        .ExcludingMissingMembers());
        }
Пример #2
0
        public async Task CreateAssetPair()
        {
            AssetPairDTO newAssetPair = await this.CreateTestAssetPair();

            Assert.NotNull(newAssetPair);

            AssetPairEntity entity = await this.AssetPairManager.TryGetAsync(newAssetPair.Id) as AssetPairEntity;

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