public Dependency(IDependencyStrategy strategy, Type type) { Strategy = strategy; Type = type; resolver = Strategy.GetResolver(type); }
public ReturnByRefDependency(Type type, ReturnByRef <T> fun, IDependencyStrategy strategy) { Type = type; Function = fun; Strategy = strategy; resolver = strategy.GetResolver(type); }
public void SetUp() { r1 = MockRepository.GenerateStub <IDependencyStrategy>(); r2 = MockRepository.GenerateStub <IDependencyStrategy>(); d1 = new Dependency("FubuCore", "1.0.0.215"); d2 = new Dependency("Bottles", "1.0.0.212"); var project = new Project("MyProject.csproj"); r1.Stub(x => x.Matches(project)).Return(false); r2.Stub(x => x.Matches(project)).Return(true); r2.Stub(x => x.Read(project)).Return(new[] { d1, d2 }); theReader = new ProjectReader(new[] { r1, r2 }); theProject = theReader.Read("MyProject.csproj"); }
public void SetUp() { r1 = MockRepository.GenerateStub<IDependencyStrategy>(); r2 = MockRepository.GenerateStub<IDependencyStrategy>(); d1 = new Dependency("FubuCore", "1.0.0.215"); d2 = new Dependency("Bottles", "1.0.0.212"); var project = new Project("MyProject.csproj"); r1.Stub(x => x.Matches(project)).Return(false); r2.Stub(x => x.Matches(project)).Return(true); r2.Stub(x => x.Read(project)).Return(new[] {d1, d2}); theReader = new ProjectReader(new[] {r1, r2}); theProject = theReader.Read("MyProject.csproj"); }
public NugetStorage(IFileSystem fileSystem, IDependencyStrategy strategy) { _fileSystem = fileSystem; _strategy = strategy; }
public void Add <T>(ReturnByRef <T> func, IDependencyStrategy strategy = null) => AddDependency(new ReturnByRefDependency <T>(typeof(T), func, strategy ?? DefaultStrategy));
public void Add <T>([CanBeNull] IDependencyStrategy strategy = null) => AddDependency(new Dependency(strategy ?? DefaultStrategy, typeof(T)));