Exemple #1
0
    public void Can_Clear_Builder()
    {
        // Arrange
        var input = new InsertCommandBuilder().Into("MyTable")
                    .AddFieldNames("Field1", "Field2", "Field3")
                    .AddFieldValues("@Field1", "@Field2", "@Field3")
                    .AppendParameters(new { Field1 = "Value1", Field2 = "Value2", Field3 = "Value3" });

        // Act
        input.Clear();

        // Assert
        input.Invoking(x => x.Build())
        .Should().Throw <InvalidOperationException>()
        .WithMessage("table name is missing");
    }