public void Add_Returns() { var fakeConfig = MakeFakeConfig(); var stubSqlParameterBuilder = new StubISqlParameterBuilder(); var stubSqlServerDataAccess = new StubISqlServerDataAccess(); var sqlServerAdapter = new BlogPostSqlServerAdapter(fakeConfig, stubSqlServerDataAccess, stubSqlParameterBuilder); var param_entity = new BlogPostFactory().Create(); stubSqlServerDataAccess.StubExecuteNonQueryStoredProcedure(1); sqlServerAdapter.Add(param_entity); }
public void Add_VerifySqlParamaterBuilder() { var fakeConfig = MakeFakeConfig(); var mockSqlParameterBuilder = new MockISqlParameterBuilder(); var stubSqlServerDataAccess = new StubISqlServerDataAccess(); var sqlServerAdapter = new BlogPostSqlServerAdapter(fakeConfig, stubSqlServerDataAccess, mockSqlParameterBuilder); var param_entity = new BlogPostFactory().Create(); stubSqlServerDataAccess.StubExecuteNonQueryStoredProcedure(1); sqlServerAdapter.Add(param_entity); mockSqlParameterBuilder.VerifyBuildSqlParameterCalled <BlogPost>(6); }