Ejemplo n.º 1
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");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 3
0
 public void ShouldHandleFailureToFindAComponentByThrowingAnExceptionByDefault()
 {
     var container = new MyContainer();
     try
     {
         container.Find<ComboBox>("Wibble");
         Assert.Fail("Should have thrown an exception");
     }
     catch(FailureToFindException) { }
 }
Ejemplo n.º 4
0
        public void ShouldHandleFailureToFindAComponentByThrowingAnExceptionByDefault()
        {
            var container = new MyContainer();

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