public void CurrentRow_exposes_underlying_reader_values()
        {
            var expectedValues = new object[12];
            expectedValues[0] = "catalog";

            using (var functionDetailsReader =
                new FunctionDetailsReader(
                    entityClientMockFactory.CreateMockEntityCommand(
                        new List<object[]> { expectedValues }).Object,
                    EntityFrameworkVersion.Version3))
            {
                Assert.Null(functionDetailsReader.CurrentRow);
                Assert.True(functionDetailsReader.Read());
                Assert.NotNull(functionDetailsReader.CurrentRow);
                Assert.Equal("catalog", functionDetailsReader.CurrentRow.Catalog);
                Assert.False(functionDetailsReader.Read());
                Assert.Null(functionDetailsReader.CurrentRow);
            }
        }
 public void CurrentRow_is_null_for_empty_reader()
 {
     using (var functionDetailsReader =
         new FunctionDetailsReader(
             entityClientMockFactory.CreateMockEntityCommand(null).Object,
             EntityFrameworkVersion.Version3))
     {
         Assert.Null(functionDetailsReader.CurrentRow);
         Assert.False(functionDetailsReader.Read());
         Assert.Null(functionDetailsReader.CurrentRow);
     }
 }
        public void CurrentRow_exposes_underlying_reader_values()
        {
            var expectedValues = new object[12];

            expectedValues[0] = "catalog";

            using (var functionDetailsReader =
                       new FunctionDetailsReader(
                           entityClientMockFactory.CreateMockEntityCommand(
                               new List <object[]> {
                expectedValues
            }).Object,
                           EntityFrameworkVersion.Version3))
            {
                Assert.Null(functionDetailsReader.CurrentRow);
                Assert.True(functionDetailsReader.Read());
                Assert.NotNull(functionDetailsReader.CurrentRow);
                Assert.Equal("catalog", functionDetailsReader.CurrentRow.Catalog);
                Assert.False(functionDetailsReader.Read());
                Assert.Null(functionDetailsReader.CurrentRow);
            }
        }
        // internal virtual for testing
        internal virtual IEnumerable <FunctionDetailsRowView> LoadFunctionDetails(IEnumerable <EntityStoreSchemaFilterEntry> filters)
        {
            var functionDetailsRows = new List <FunctionDetailsRowView>();

            using (var command = CreateFunctionDetailsCommand(filters))
            {
                using (var reader = new FunctionDetailsReader(command, _storeSchemaModelVersion))
                {
                    while (reader.Read())
                    {
                        functionDetailsRows.Add(reader.CurrentRow);
                    }
                }
            }
            return(functionDetailsRows);
        }