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."); }
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); } }
public void Build_NamedKustoTable_Should_ReturnNameFromAttribute() { var act = KustoTableSchemaBuilder.Build <Fixture.NamedKustoTable>(); act.TableName.Should().Be("named_kusto_table"); }
public void Build_OnUnnamedKustoTable_Should_ReturnClassName() { var act = KustoTableSchemaBuilder.Build <Fixture.UnnamedKustoTable>(); act.TableName.Should().Be(nameof(Fixture.UnnamedKustoTable)); }
public void Build_OnUnnamedKustoColumn_Should_ReturnPropertyName() { var act = KustoTableSchemaBuilder.Build <Fixture.UnnamedKustoColumn>(); act.Columns.Should().ContainKey(nameof(Fixture.UnnamedKustoColumn.Property)); }
public void Build_OnNull_Should_ThrowException() { Action act = () => KustoTableSchemaBuilder.Build(null); act.Should().Throw <ArgumentNullException>(); }