예제 #1
0
        public T Instance <T>(params GenerationCustomization[] customizations)
        {
            var trace = new ListBasedGenerationTrace();

            try
            {
                trace.BeginCreatingInstanceGraphWith(typeof(T));
                return(_fakeChainFactory.GetInstance <T>().Resolve(new CustomizedGenerator(SynchronizedThis, customizations), trace));
            }
            catch (Exception e)
            {
                throw new GenerationFailedException(trace, e);
            }
        }
예제 #2
0
        public T Instance <T>()
        {
            var trace = new ListBasedGenerationTrace();

            try
            {
                trace.BeginCreatingInstanceGraphWith(typeof(T));
                return(Instance <T>(trace));
            }
            catch (Exception e)
            {
                throw new GenerationFailedException(trace, e);
            }
        }