public void ArgumentNullExceptionIsThrownWhenExecutingAsyncStoredProcAccessorWithNullParameterMapper()
        {
            Database db = new DatabaseProviderFactory(base.ConfigurationSource).Create("DefaultSqlAsync");
            CustomParameterMapper defaultParamMapper = null;

            db.CreateSprocAccessor <TopTenProduct>("GetTestData", defaultParamMapper);
        }
        public void ArgumentNullExceptionIsThrownWhenExecutingStoredProcWithParamterAndNullMapper()
        {
            object[] paramsArray = { "1" };
            CustomParameterMapper defaultParamMapper = null;

            sqlDatabase.ExecuteSprocAccessor <Test>("GetTest", defaultParamMapper, paramsArray);
        }
        public void InvalidOperationExceptionIsThrownWhenExecutingInValidStoredProcWithParamter()
        {
            object[] paramsArray = { "1" };
            CustomParameterMapper defaultParamMapper = new CustomParameterMapper(sqlDatabase);

            sqlDatabase.ExecuteSprocAccessor <Test>("GetTestInvalid", defaultParamMapper, paramsArray);
        }
        public void FormatExceptionIsThrownWhenExecutingStoredProcWithInValidParamter()
        {
            // Expected parameter type is int but invalid parameter string is passed.
            object[] paramsArray = { "a" };
            CustomParameterMapper defaultParamMapper = new CustomParameterMapper(sqlDatabase);
            IEnumerable <Test>    result             = sqlDatabase.ExecuteSprocAccessor <Test>("GetTest", defaultParamMapper,
                                                                                               paramsArray);

            result.First();
        }
        public void ResultsAreReturnedWhenExecutingStoredProcWithParamterAndCustomMapper()
        {
            object[] paramsArray = { "10" };
            CustomParameterMapper defaultParamMapper = new CustomParameterMapper(sqlDatabase);
            IEnumerable <Test>    result             = sqlDatabase.ExecuteSprocAccessor <Test>("GetTest", defaultParamMapper,
                                                                                               paramsArray);

            var last = result.Last();

            Assert.AreEqual("Test10", last.TestName);
        }