Beispiel #1
0
        public async Task TestDateColumn()
        {
            using var testScope = fixture.PrepareExplorationTestScope(Cassette.GenerateVcrFilename(this));

            await testScope.RunAndCheckMetrics(
                "gda_banking",
                "loans",
                "birthdate",
                metrics => Assert.True(metrics.Any()));
        }
Beispiel #2
0
        public async Task TestDatetimeColumn()
        {
            using var testScope = fixture.PrepareExplorationTestScope(Cassette.GenerateVcrFilename(this));

            await testScope.RunAndCheckMetrics(
                "gda_taxi",
                "rides",
                "pickup_datetime",
                metrics => Assert.True(metrics.Any()));
        }
Beispiel #3
0
        public async Task TestBooleanColumn()
        {
            using var testScope = fixture.PrepareExplorationTestScope(Cassette.GenerateVcrFilename(this));

            await testScope.RunAndCheckMetrics(
                "GiveMeSomeCredit",
                "loans",
                "SeriousDlqin2yrs",
                metrics => Assert.True(metrics.Any()));
        }
        public async void TestLastName()
        {
            using var scope = testFixture.SimpleComponentTestScope(
                      "gda_banking",
                      "cards",
                      "lastname",
                      Cassette.GenerateVcrFilename(this));

            await scope.ResultTest <EmailCheckComponent, bool>(Assert.False);

            await scope.ResultTest <TextGeneratorComponent, IEnumerable <string> >(result =>
                                                                                   Assert.True(result.All(v => v.Length >= 3)));
        }
Beispiel #5
0
        public async Task <TestScope> CreateTestScope(
            string dataSource,
            string table,
            IEnumerable <string> columns,
            object caller,
            [CallerMemberName] string callerMemberName = "")
        {
            var vcrFileName = Cassette.GenerateVcrFilename(caller, callerMemberName);
            var columnInfo  = await GetColumnInfo(dataSource, table, columns).Collect();

            var samplesToPublish = Config.Get <ExplorerOptions>().DefaultSamplesToPublish;

            return(new TestScope(Container, ApiUri, dataSource, table, columns, columnInfo, vcrFileName, samplesToPublish));
        }
Beispiel #6
0
        public async Task TestMultiColumn()
        {
            using var testScope = fixture.PrepareExplorationTestScope(Cassette.GenerateVcrFilename(this));

            await testScope.RunAndCheckMetrics(
                "gda_banking",
                "loans",
                new[] { "firstname", "duration" },
                metrics =>
            {
                Assert.True(metrics["firstname"].Any());
                Assert.True(metrics["duration"].Any());
                Assert.True(metrics.Count == 2);
            });
        }
        public async void TestCardsEmail()
        {
            using var scope = testFixture.SimpleComponentTestScope(
                      "gda_banking",
                      "cards",
                      "email",
                      Cassette.GenerateVcrFilename(this));

            await scope.ResultTest <EmailCheckComponent, bool>(Assert.True);

            await scope.ResultTest <TextGeneratorComponent, IEnumerable <string> >(result =>
            {
                Assert.True(result.All(v => v.Length >= 3));
                Assert.True(result.All(v => v.Count(c => c == '@') == 1));
                Assert.True(result.All(v => v.Contains('.', StringComparison.InvariantCulture)));
                Assert.True(result.All(v => !v.Contains("..", StringComparison.InvariantCulture)));
            });
        }
Beispiel #8
0
 public static string GenerateVcrFilename(object caller, [CallerMemberName] string name = "") =>
 Cassette.GenerateVcrFilename(caller, name);