public async Task Test_ParseOk()
        {
            var fixture = new Fixture();

            fixture.Behaviors
            .OfType <ThrowingRecursionBehavior>()
            .ToList()
            .ForEach(b => fixture.Behaviors.Remove(b));
            fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            using (var test = new Flurl.Http.Testing.HttpTest())
            {
                test.RespondWithJson(new ParseWitMessageResponse
                {
                    Text         = "text",
                    IsSuccessful = true,
                    MessageId    = System.Guid.NewGuid().ToString(),
                    Entities     = new Dictionary <string, List <WitParsedEntity> >
                    {
                        { "entity1", new List <WitParsedEntity>(fixture.CreateMany <WitParsedEntity>(5)) },
                        { "entity2", new List <WitParsedEntity>(fixture.CreateMany <WitParsedEntity>(5)) },
                        { "entity3", new List <WitParsedEntity>(fixture.CreateMany <WitParsedEntity>(5)) }
                    }
                });

                var loggerMock = new Mock <ILogger <WitAi.WitAiClient> >(MockBehavior.Loose);
                var config     = new Core.Configuration.WitAiConfiguration
                {
                    ApiKey     = "someapikey",
                    ApiVersion = "someapiversion",
                    BaseUrl    = "http://someurl.fqdn.local"
                };
                var options = new Mock <IOptionsSnapshot <Core.Configuration.WitAiConfiguration> >(MockBehavior.Strict);
                options.Setup(o => o.Value)
                .Returns(() => config);

                var sut = new WitAi.WitAiClient(loggerMock.Object, options.Object);

                var result = await sut.Parse("test string");

                Assert.NotNull(result);
                Assert.Null(result.ErrorMessage);
                Assert.NotNull(result.Entities);
                Assert.NotEmpty(result.Entities);

                foreach (var entity in result.Entities)
                {
                    Assert.StartsWith("entity", entity.Name);
                    Assert.Equal(5, entity.Values.Count);
                }
            }
        }
        public async Task Get_Should_ReturnAllData_When_ApiReturnsOK()
        {
            using (var httpTest = new Flurl.Http.Testing.HttpTest())
            {
                // Arrange
                httpTest.RespondWithJson(new { msg = "hello from the mock" }, 200);
                dataSourceMock.Setup(ma => ma.GetAll())
                .ReturnsAsync(() => _dataSources);

                // Act
                var response = await _client.GetAsync("/api/allData");

                response.EnsureSuccessStatusCode();
                var responseString = await response.Content.ReadAsStringAsync();

                // Assert
                dataSourceMock.VerifyAll();
                Assert.IsTrue(responseString.Contains("hello from the mock"), $"Response string {responseString} should contain the url of mock server");
            }
        }