コード例 #1
0
    public void Can_Filter_Empty_Property_Values_On_Dump()
    {
        // Arrange
        var input  = new MyFlatClass();
        var filter = new SkipDefaultValues();

        // Act
        var actual = Dump(input, new[] { filter });

        // Asset
        actual.Should().Be(@"new CsharpExpressionDumper.Core.Tests.TestData.MyFlatClass()");
    }
コード例 #2
0
    public void Can_Dump_Flat_Class_To_Csharp()
    {
        // Arrange
        var input = new MyFlatClass {
            Property1 = "hello", Property2 = 1, Property3 = true
        };

        // Act
        var actual = Dump(input);

        // Assert
        actual.Should().Be(@"new CsharpExpressionDumper.Core.Tests.TestData.MyFlatClass
{
    Property1 = @""hello"",
    Property2 = 1,
    Property3 = true,
}");
    }