A theoretical and experimental benchmark study of core-excited states in nitrogen