Exemple #1
0
            public Dependency(IDependencyStrategy strategy, Type type)
            {
                Strategy = strategy;
                Type     = type;

                resolver = Strategy.GetResolver(type);
            }
Exemple #2
0
            public ReturnByRefDependency(Type type, ReturnByRef <T> fun, IDependencyStrategy strategy)
            {
                Type     = type;
                Function = fun;
                Strategy = strategy;

                resolver = strategy.GetResolver(type);
            }
Exemple #3
0
        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;
 }
Exemple #6
0
 public NugetStorage(IFileSystem fileSystem, IDependencyStrategy strategy)
 {
     _fileSystem = fileSystem;
     _strategy = strategy;
 }
Exemple #7
0
 public void Add <T>(ReturnByRef <T> func, IDependencyStrategy strategy = null) => AddDependency(new ReturnByRefDependency <T>(typeof(T), func, strategy ?? DefaultStrategy));
Exemple #8
0
 public void Add <T>([CanBeNull] IDependencyStrategy strategy           = null) => AddDependency(new Dependency(strategy ?? DefaultStrategy, typeof(T)));