Exemplo n.º 1
0
            public void should_store_aggregated_result_for_T()
            {
                var resolved = ConfigurationResult <TestConfigured> .Create();

                _sourceResolver.Resolve <TestConfigured>().Returns(resolved);

                _cut.Get <TestConfigured>();

                _resultStore.Received().Store(resolved);
            }
Exemplo n.º 2
0
        public T Get <T>() where T : class, IConfigured, new()
        {
            var existingResult = _resultStore.Get <T>();

            if (existingResult != null)
            {
                return(existingResult);
            }

            var configurationResult = _sourceResolver.Resolve <T>();

            _resultStore.Store(configurationResult);

            return(configurationResult.Result);
        }