Beispiel #1
0
    public void No_CustomFields_Returns_Empty_List()
    {
        // Arrange

        // Act
        var result = QueryPostsF.GetCustomFields <NoCustomFields>();

        // Assert
        Assert.Empty(result);
    }
Beispiel #2
0
    public void With_CustomFields_Returns_PropertyInfo()
    {
        // Arrange

        // Act
        var result = QueryPostsF.GetCustomFields <WithCustomFields>();

        // Assert
        Assert.Collection(result,
                          x =>
        {
            Assert.Equal(nameof(WithCustomFields.Field0), x.Name);
            Assert.True(typeof(ICustomField).IsAssignableFrom(x.PropertyType));
        },
                          x =>
        {
            Assert.Equal(nameof(WithCustomFields.Field1), x.Name);
            Assert.True(typeof(ICustomField).IsAssignableFrom(x.PropertyType));
        }
                          );
    }