public int Insert(GameLineModel obj) { using (IDbConnection connection = new SqlConnection(ConnectionStrings.Core)) { return(connection .Query <int>( "sp_insert_game_line", new { obj.GameId, obj.Score }, commandType: CommandType.StoredProcedure) .Single()); } }
public void Insert_returns_new_id_with_value_greater_than_zero() { // Arrange var dbModel = new GameLineModel { GameId = 1, Score = 1 }; // Act var newId = new GameLineRepository().Insert(dbModel); // Assert Assert.IsTrue(newId > 0); }