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'");
        }
        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'");
        }
Exemple #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);
            }
        }