예제 #1
0
        protected TMockBuilder AddMockGrain <TGrain, TMockBuilder>()
            where TGrain : class, IGrain
            where TMockBuilder : BaseMockBuilder <TMockBuilder, TGrain>, new()
        {
            var mockBuilder = new TMockBuilder();

            Silo.AddProbe(id => mockBuilder.Mock);
            return(mockBuilder);
        }
        public Func <TMockBuilder> AddMock <TMockBuilder, T>()
            where TMockBuilder : IBuilder <TMockBuilder, T>, new()
            where T : class
        {
            return(() =>
            {
                if (!_mocks.ContainsKey(typeof(T)))
                {
                    _mocks[typeof(T)] = new TMockBuilder();
                }

                return (TMockBuilder)_mocks[typeof(T)];
            });
        }