public void ShouldAllowTheFailureToFindHandlerToBeSet()
        {
            var container = new MyContainer();
            var complained = true;
            container.HandlerForFailingToFind = (s) => complained = true;
            container.Find<ComboBox>("Wibble");

            Assert.True(complained, "Should have handled failure to find using the given handler");
        }
Exemple #2
0
        public void ShouldAllowTheFailureToFindHandlerToBeSet()
        {
            var container  = new MyContainer();
            var complained = true;

            container.HandlerForFailingToFind = (s) => complained = true;
            container.Find <ComboBox>("Wibble");

            Assert.True(complained, "Should have handled failure to find using the given handler");
        }
 public void ShouldHandleFailureToFindAComponentByThrowingAnExceptionByDefault()
 {
     var container = new MyContainer();
     try
     {
         container.Find<ComboBox>("Wibble");
         Assert.Fail("Should have thrown an exception");
     }
     catch(FailureToFindException) { }
 }
Exemple #4
0
        public void ShouldHandleFailureToFindAComponentByThrowingAnExceptionByDefault()
        {
            var container = new MyContainer();

            try
            {
                container.Find <ComboBox>("Wibble");
                Assert.Fail("Should have thrown an exception");
            }
            catch (FailureToFindException) { }
        }