2. If the polynomial $x^{2}-x+1$ can divide another polynomial $x^{3}+x^{2}+a x+b(a, b$ are constants). Then $a+b$ equals ( ).
(A) 0
(B) -1
(C) 1
(D) 2
2. (C).

By synthetic division, it is easy to obtain the remainder $r(x)=(a+1) x+b-2$. Since it can be divided exactly, we have $a+1=0$ and $b-2=0$, i.e., $a=-1, b=2$. Therefore, $a+b=1$.