コード例 #1
0
        public void SetUp()
        {
            thePlanBuilder = MockRepository.GenerateStub <INugetPlanBuilder>();

            var r1 = new NugetPlanRequest {
                Dependency = new Dependency("d1")
            };
            var r2 = new NugetPlanRequest {
                Dependency = new Dependency("d2")
            };
            var r3 = new NugetPlanRequest {
                Dependency = new Dependency("d3")
            };

            s1 = MockRepository.GenerateStub <INugetStep>();
            s2 = MockRepository.GenerateStub <INugetStep>();
            s3 = MockRepository.GenerateStub <INugetStep>();

            thePlanBuilder.Stub(x => x.PlanFor(r1)).Return(new NugetPlan(s1));
            thePlanBuilder.Stub(x => x.PlanFor(r2)).Return(new NugetPlan(s2));
            thePlanBuilder.Stub(x => x.PlanFor(r3)).Return(new NugetPlan(s3));

            theSolution = new Solution();
            theSolution.UseBuilder(thePlanBuilder);
            theSolution.UseStorage(new StubNugetStorage());

            var input = new StubNugetOperationContext(r1, r2, r3);

            new NugetOperation {
                Solution = theSolution
            }.Execute(input, null);
        }
コード例 #2
0
        public void SetUp()
        {
            thePlanBuilder = MockRepository.GenerateStub<INugetPlanBuilder>();

            var r1 = new NugetPlanRequest { Dependency = new Dependency("d1")};
            var r2 = new NugetPlanRequest { Dependency = new Dependency("d2") };
            var r3 = new NugetPlanRequest { Dependency = new Dependency("d3") };

            s1 = MockRepository.GenerateStub<INugetStep>();
            s2 = MockRepository.GenerateStub<INugetStep>();
            s3 = MockRepository.GenerateStub<INugetStep>();

            thePlanBuilder.Stub(x => x.PlanFor(r1)).Return(new NugetPlan(s1));
            thePlanBuilder.Stub(x => x.PlanFor(r2)).Return(new NugetPlan(s2));
            thePlanBuilder.Stub(x => x.PlanFor(r3)).Return(new NugetPlan(s3));
            
            theSolution = new Solution();
            theSolution.UseBuilder(thePlanBuilder);
            theSolution.UseStorage(new StubNugetStorage());

            var input = new StubNugetOperationContext(r1, r2, r3);
            new NugetOperation { Solution = theSolution}.Execute(input, null);
        }