The expression 1 + 2
in int test = 1 + 2
is considered to be a "constant-expression" according to the C# spec:
7.19 Constant expressions
A constant-expression is an expression that can be fully evaluated at compile-time.
In other words: when an expression can be fully evaluated at compile-time, it is considered to be a "constant expression", and those will be evaluated at compile-time.
Kind of a catch-22 when you want to discover the meaning of a constant expression and compile-time evaluation.
To apply the relevant parts of the spec to your example:
A constant expression must be [...] a value with one of the following types: [...] int [...].
Only the following constructs are permitted in constant expressions:
Literals (including the null literal).
[...]
The predefined +, –, *, /, %, <<, >>, &, |, ^, &&, ||, ==, !=, <, >, <=, and >= binary operators, provided each operand is of a type listed above.
[...]
Whenever an expression fulfills the requirements listed above, the expression is evaluated at compile-time.
The last line would be clearer if it would read:
Whenever an expression fulfills the requirements listed above, the expression is [considered to be a constant expression and will be] evaluated at compile-time.
When an expression contradicts any of the listed rules (including things such as using a non-const member invocation or a method call), it will not be considered a constant expression and thus be evaluated at runtime.