public void CreateSubstituteDataReader_GivenData_And_AdditionalColumnValues_ShouldReturnDataReaderWithExpectedData() { //---------------Set up test pack------------------- var dataReaderData = new List <dynamic> { new { Id = Guid.NewGuid(), Name = RandomValueGenerator.CreateRandomString(10, 50) }, new { Id = Guid.NewGuid(), Name = RandomValueGenerator.CreateRandomString(10, 50) }, new { Id = Guid.NewGuid(), Name = RandomValueGenerator.CreateRandomString(10, 50) } }; var additionalColumnValues = new Dictionary <string, object> { { "Sequence", RandomValueGenerator.CreateRandomInt(100, 500) }, { "Amount", RandomValueGenerator.CreateRandomDecimal(1000, 5000) }, }; //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var dataReader = TestHelper.CreateSubstituteDataReader(dataReaderData, additionalColumnValues); //---------------Test Result ----------------------- var allFakeData = new List <FakeDataClass>(); while (dataReader.Read()) { var dataClass = new FakeDataClass { Id = dataReader.GetValue <Guid>(nameof(FakeDataClass.Id)), Name = dataReader.GetValue <string>(nameof(FakeDataClass.Name)), Sequence = dataReader.GetValue <int>(nameof(FakeDataClass.Sequence)), Amount = dataReader.GetValue <decimal>(nameof(FakeDataClass.Amount)), }; allFakeData.Add(dataClass); } allFakeData.Count.Should().Be(3); foreach (var currentData in dataReaderData) { var foundDataClass = allFakeData.FirstOrDefault(dataClass => dataClass.Id.Equals(currentData.Id)); foundDataClass.Should().NotBeNull(); foundDataClass?.Name.Should().Be(currentData.Name); foundDataClass?.Sequence.Should().Be((int)additionalColumnValues["Sequence"]); foundDataClass?.Amount.Should().Be((decimal)additionalColumnValues["Amount"]); } }