コード例 #1
0
        public void Build_OnDuplicatedColumName_Should_ThrowException()
        {
            var _ = $"{nameof(Fixture.DuplicatedNameKustoColum.Property1)}" +
                    $"_{nameof(Fixture.DuplicatedNameKustoColum.Property2)}";

            Action act = () => KustoTableSchemaBuilder.Build <Fixture.DuplicatedNameKustoColum>();

            act.Should().Throw <InvalidOperationException>()
            .WithMessage("Column name `*` already exist.");
        }
コード例 #2
0
        public void Build_OnClassBasedProperties_Should_BuildDescription(Type classWithProperies, Type expectedPropertyType)
        {
            var act = KustoTableSchemaBuilder.Build(classWithProperies);

            using (new AssertionScope())
            {
                act.Columns["property"].Name.Should().Be("property");
                act.Columns["property"].SourcePropertyName.Should().Be(nameof(Fixture.ClassBasedPropertiesClass <object> .Property));
                act.Columns["property"].Type.Should().Be(expectedPropertyType);
            }
        }
コード例 #3
0
        public void Build_NamedKustoTable_Should_ReturnNameFromAttribute()
        {
            var act = KustoTableSchemaBuilder.Build <Fixture.NamedKustoTable>();

            act.TableName.Should().Be("named_kusto_table");
        }
コード例 #4
0
        public void Build_OnUnnamedKustoTable_Should_ReturnClassName()
        {
            var act = KustoTableSchemaBuilder.Build <Fixture.UnnamedKustoTable>();

            act.TableName.Should().Be(nameof(Fixture.UnnamedKustoTable));
        }
コード例 #5
0
        public void Build_OnUnnamedKustoColumn_Should_ReturnPropertyName()
        {
            var act = KustoTableSchemaBuilder.Build <Fixture.UnnamedKustoColumn>();

            act.Columns.Should().ContainKey(nameof(Fixture.UnnamedKustoColumn.Property));
        }
コード例 #6
0
        public void Build_OnNull_Should_ThrowException()
        {
            Action act = () => KustoTableSchemaBuilder.Build(null);

            act.Should().Throw <ArgumentNullException>();
        }