You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] - InputValueExtractor fais on objects with indexes #951
`
private class PocoClassWithIndex
{
public string Name { get; set; }
public object this[string name] => Name;
public int Age { get; set; }
public IEnumerable Fruits; // Field
};
[Fact]
public void ToValueDictionary_Given_InputIsPocoClass_Then_Output_IsAnEquivalentDictionary()
{
var valueObject = new PocoClassWithIndex
{
Name = "John",
Age = 18,
Fruits = new List<string> { "Apples, Oranges" }
};
var expectedOutput = new Dictionary<string, object>
{
["Name"] = "John",
["Age"] = 18,
["Fruits"] = new List<string> { "Apples, Oranges" }
};
var sut = new InputValueExtractor();
var result = sut.ToValueDictionary(valueObject);
Assert.Equal(result.Count, expectedOutput.Count);
foreach (var (key, value) in result)
{
Assert.Equal(value, expectedOutput[key]);
}
}
Activity