public void GetEventsTest_GetConnectionException() { _connectionFactoryMock.Setup(x => x.GetConnection()).Throws(new Exception()); var eventsDataProvider = new EventsDataProvider(_connectionFactoryMock.Object); eventsDataProvider.Getevents(); }
public void GetEventsTest_CreateCommandFailed() { _connectionFactoryMock.Setup(x => x.GetConnection()).Returns(_dbConnectionMock.Object); _dbConnectionMock.Setup(x => x.Open()); _dbConnectionMock.Setup(x => x.CreateCommand()).Throws(new Exception()); var eventsDataProvider = new EventsDataProvider(_connectionFactoryMock.Object); eventsDataProvider.Getevents(); }
public void GetEventsTest_OpenException() { var connection = new SqlConnection(); _connectionFactoryMock.Setup(x => x.GetConnection()).Returns(connection); _dbConnectionMock.Setup(x => x.Open()).Throws(new Exception()); var eventsDataProvider = new EventsDataProvider(_connectionFactoryMock.Object); eventsDataProvider.Getevents(); }