Esempio n. 1
0
            public Dependency(IDependencyStrategy strategy, Type type)
            {
                Strategy = strategy;
                Type     = type;

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

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