public void PowerPersonalityChangedEventWorks(PowerPersonality powerPersonalityToSet)
        {
            PowerPersonality original   = PowerManager.PowerPersonality;
            bool             eventFired = false;

            PowerManager.PowerPersonalityChanged += new System.EventHandler(
                (object sender, EventArgs e) =>
            {
                eventFired = true;
            }
                );

            // TODO: Change PowerManager.PowerPersonality, it is readonly.

            int secTimeout = 5; //wait 5 seconds for event to be fired.

            for (int i = 0; i < secTimeout * 10 && !eventFired; i++)
            {
                Thread.Sleep(100);
            }

            // TODO: PowerManager.PowerPersonality = original;

            Assert.True(eventFired);
        }
 public void PowerPersonalityPropertyDoesNotThrow()
 {
     Assert.DoesNotThrow(() =>
     {
         PowerPersonality pp = PowerManager.PowerPersonality;
     });
 }
        public void PowerPersonalityChangedEventWorks(PowerPersonality powerPersonalityToSet)
        {
            PowerPersonality original = PowerManager.PowerPersonality;
            bool eventFired = false;

            PowerManager.PowerPersonalityChanged += new System.EventHandler(
                (object sender, EventArgs e) =>
                {
                    eventFired = true;
                }
            );

            // TODO: Change PowerManager.PowerPersonality, it is readonly.

            int secTimeout = 5; //wait 5 seconds for event to be fired.
            for (int i = 0; i < secTimeout * 10 && !eventFired; i++)
            {
                Thread.Sleep(100);
            }

            // TODO: PowerManager.PowerPersonality = original;

            Assert.True(eventFired);
        }