Ejemplo n.º 1
0
        public async Task ApiHubTableEntityIn()
        {
            TestHelpers.ClearFunctionLogs("ApiHubTableEntityIn");

            // Ensure the test entity exists.
            await ApiHubTestHelper.EnsureEntityAsync(ApiHubTestHelper.EntityId4);

            // Test table entity out binding.
            JObject input = new JObject
            {
                { "table", "SampleTable" },
                { "id", ApiHubTestHelper.EntityId4 }
            };
            await Fixture.Host.CallAsync("ApiHubTableEntityIn",
                                         new Dictionary <string, object>()
            {
                { "input", input.ToString() }
            });

            var logs = await TestHelpers.GetFunctionLogsAsync("ApiHubTableEntityIn");

            string expectedLog = string.Format("TestResult: {0}", ApiHubTestHelper.EntityId4);

            Assert.True(logs.Any(p => p.Contains(expectedLog)));
        }
Ejemplo n.º 2
0
        public async Task ApiHubTableEntityOut()
        {
            var textArgValue = ApiHubTestHelper.NewRandomString();

            // Delete the test entity if it exists.
            await ApiHubTestHelper.DeleteEntityAsync(ApiHubTestHelper.EntityId5);

            // Test table entity out binding.
            JObject input = new JObject
            {
                { "table", "SampleTable" },
                { "value", textArgValue }
            };
            await Fixture.Host.CallAsync("ApiHubTableEntityOut",
                                         new Dictionary <string, object>()
            {
                { "input", input.ToString() }
            });

            await ApiHubTestHelper.AssertTextUpdatedAsync(
                textArgValue, ApiHubTestHelper.EntityId5);
        }