title: Confusion with parsing an Enum
body: <p>I am converting a numeric value that is of string type into a corresponding Enum. While I was testing my code, I discovered interesting behavior that has me confused. </p>
  
  <p>Using the code example below, can somebody shed light on why an exception isn't thrown if/when the "s" variable has a value that doesn't match one of the Enum values? Also, how is that the sEnum var can be set to a value that doesn't exist within the definition of the Stooge enum?</p>
  
  <pre><code>class Program
  {
      enum Stooge
      {
          Unspecified,
          Moe,
          Larry,
          Curly,
          Shemp
      }
  
      static void Main(string[] args)
      {
          while (true)
          {
              Console.WriteLine("Enter a number...");
  
              string s = Console.ReadLine();
              Stooge sEnum = (Stooge)(int.Parse(s)); //Why doesn't this line throw if s != 0, 1, 2, 3, or 4?
  
              Console.WriteLine("\r\nYou entered: {0}\r\nEnum String Value: {1}\r\nEnum Int Value: {2}\r\n", s, sEnum.ToString(), (int)sEnum);
          }
      }
  }
  </code></pre>