public void ShouldNotInjectValuesIfChildEnumerableIsNull() { ValueInjector.UseValueObtainer(_remoteValueObtainer); var testData = new EnumerableChildPropertyTestData { TestDatas = null }; ValueInjector.InjectValues(testData); Assert.Null(testData.TestDatas); }
public void ShouldInjectValuesInChildEnumerable() { ValueInjector.UseValueObtainer(_remoteValueObtainer); var testData = new EnumerableChildPropertyTestData { TestDatas = new List <TestData> { new TestData { ValueKey = 1 }, new TestData { ValueKey = 2 } } }; ValueInjector.InjectValues(testData); foreach (var element in testData.TestDatas) { Assert.NotNull(element.Value); Assert.Equal(element.ValueKey.ToString(), element.Value); } }