Ejemplo n.º 1
0
        private static void AtAppDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            // e.IsTerminating
            // e.ExceptionObject

            var exception = e.ExceptionObject as Exception;

            if (exception == null)
            {
                exception = new AppDomainUnloadedException("An unspecified exception has occured!");
            }
            OnUnhandledException(new RoutedUnhandledExceptionEventArgs(e));
        }
Ejemplo n.º 2
0
        public void TestTweetBestWorkoutWeek()
        {
            var t       = new AppDomainUnloadedException();
            var athlete = new Athlete(null, Gender.Male, 27, 201, 72);
            var w       = new BikeWorkout(WorkoutType.Outdoor, 8.21, DateTime.Now, TimeSpan.FromMinutes(67), 113, "Learning how to bike in the streets :O");
            var w2      = new Workout(DateTime.Now.AddDays(-4), new TimeSpan(1, 2, 43), 132, "500 lb squat day. #gainz");

            athlete.AddWorkout(w, w2);

            var v = athlete.Username.Length;

            var tweet = athlete.tweetTodaysWorkout();

            Assert.AreEqual(120, tweet.Length, 20);
        }
        public void Extensions_AppDomainUnloadedExceptionIsCriticalTest()
        {
            var ex = new AppDomainUnloadedException();

            Assert.IsTrue(ex.IsCritical());
        }