コード例 #1
0
        public void CanAddMetadataUsingDto()
        {
            var client     = GetClient();
            var category   = "Integration";
            var collection = "Tests";
            var key        = "556988";

            var expected = new AssetAccountMetadata
            {
                AccountNumber               = key,
                MarginAccount               = "MA01",
                ReferenceAccount            = "RF11",
                BankIdentificationReference = "BIR11",
            };

            AssetAccountMetadata actual = null;

            $"Given the AssetAccountMetadata for key: {key}"
            .x(async() =>
            {
                await client.Create(category, collection, key, new MetadataModelContract
                {
                    Data = expected.ToJson(),
                });
            });

            $"When try to get AssetAccountMetadata for the key: {key}"
            .x(async() =>
            {
                actual = (await client.Get(category, collection, key)).Get <AssetAccountMetadata>();
            });

            "Then the fetched AssetAccountMetadata should be same"
            .x(() =>
            {
                Assert.NotNull(actual);
                actual.Should().BeEquivalentTo(expected);
            });
        }
コード例 #2
0
        public void CanAddMetadataWithoutKeywords()
        {
            // arrange
            var client     = new ChestClient(this.ServiceUrl, new[] { new SuccessHandler() });
            var category   = "Integration";
            var collection = "Tests";
            var key        = "456989";

            var expected = new AssetAccountMetadata
            {
                AccountNumber               = key,
                MarginAccount               = "MA02",
                ReferenceAccount            = "RF12",
                BankIdentificationReference = "BIR12",
            };

            AssetAccountMetadata actual = null;

            $"Given the metadata for category: {category} collection: {collection} key: {key}"
            .x(async() =>
            {
                await client.Metadata.Add(category, collection, key, expected).ConfigureAwait(false);
            });

            $"When try to get metadata for the category: {category} collection: {collection} key: {key}"
            .x(async() =>
            {
                actual = await client.Metadata.Get <AssetAccountMetadata>(category, collection, key).ConfigureAwait(false);
            });

            "Then the fetched metadata should be same"
            .x(() =>
            {
                Assert.NotNull(actual);
                actual.Should().BeEquivalentTo(expected);
            });
        }
コード例 #3
0
        public void CanAddMetadataWithoutKeywords()
        {
            // arrange
            var client     = GetClient();
            var category   = "Integration";
            var collection = "Tests";
            var key        = "456989";

            var expected = new AssetAccountMetadata
            {
                AccountNumber               = key,
                MarginAccount               = "MA02",
                ReferenceAccount            = "RF12",
                BankIdentificationReference = "BIR12",
            };

            AssetAccountMetadata actual = null;

            $"Given the metadata for category: {category} collection: {collection} key: {key}"
            .x(async() =>
            {
                await client.Create(category, collection, key, expected.ToChestContract());
            });

            $"When try to get metadata for the category: {category} collection: {collection} key: {key}"
            .x(async() =>
            {
                actual = (await client.Get(category, collection, key)).Get <AssetAccountMetadata>();
            });

            "Then the fetched metadata should be same"
            .x(() =>
            {
                Assert.NotNull(actual);
                actual.Should().BeEquivalentTo(expected);
            });
        }