public void Sad_path_inner_function_throws_exception_207_with_key_and_plugin_type()
        {
            var instance = new LambdaInstance <object>("throws", () => { throw new NotImplementedException(); });

            var ex = Exception <StructureMapBuildException> .ShouldBeThrownBy(() => {
                instance.Build <IWidget>(new StubBuildSession());
            });

            ex.Title.ShouldContain("'Lambda: throws'");
        }
Esempio n. 2
0
        public void Sad_path_inner_function_throws_exception_207_with_key_and_plugin_type()
        {
            var instance = new LambdaInstance<object>("throws", () => { throw new NotImplementedException(); });

            var ex =
                Exception<StructureMapBuildException>.ShouldBeThrownBy(
                    () => { instance.Build<IWidget>(new StubBuildSession()); });

            ex.Title.ShouldContain("'Lambda: throws'");
        }
Esempio n. 3
0
        public void Sad_path_inner_function_throws_exception_207_with_key_and_plugin_type()
        {
            var instance = new LambdaInstance <object>(() => { throw new NotImplementedException(); });

            try
            {
                instance.Build(typeof(IWidget), new StubBuildSession());
                Assert.Fail("Should have thrown an exception");
            }
            catch (StructureMapException ex)
            {
                Assert.AreEqual(207, ex.ErrorCode);
            }
        }
        public void Sad_path_inner_function_throws_exception_207_with_key_and_plugin_type()
        {
            var instance = new LambdaInstance<object>(() => { throw new NotImplementedException(); });

            try
            {
                instance.Build(typeof (IWidget), new StubBuildSession());
                Assert.Fail("Should have thrown an exception");
            }
            catch (StructureMapException ex)
            {
                Assert.AreEqual(207, ex.ErrorCode);
            }
        }