public async Task UpdateMarginAsset() { string url = ApiPaths.MARGIN_ASSET_BASE_PATH; MarginAssetDTO TestMarginAssetUpdate = await CreateTestMarginAsset(); MarginAssetDTO updateDTO = new MarginAssetDTO() { Id = TestMarginAssetUpdate.Id, Name = TestMarginAssetUpdate.Name, IdIssuer = TestMarginAssetUpdate.IdIssuer, Symbol = TestMarginAssetUpdate.Symbol, Accuracy = Helpers.Random.Next(2, 8), DustLimit = Helpers.Random.NextDouble(), Multiplier = Helpers.Random.NextDouble() }; string updateParam = JsonUtils.SerializeObject(updateDTO); var response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, updateParam, Method.PUT); Assert.True(response.Status == HttpStatusCode.NoContent); MarginAssetEntity entity = await this.MarginAssetManager.TryGetAsync(updateDTO.Id) as MarginAssetEntity; Assert.NotNull(entity); entity.ShouldBeEquivalentTo(updateDTO, o => o.ExcludingMissingMembers()); }
public async Task CreateMarginAsset() { MarginAssetDTO createdDTO = await this.CreateTestMarginAsset(); Assert.NotNull(createdDTO); MarginAssetEntity entity = await this.MarginAssetManager.TryGetAsync(createdDTO.Id) as MarginAssetEntity; Assert.NotNull(entity); entity.ShouldBeEquivalentTo(createdDTO, o => o.ExcludingMissingMembers()); }