예제 #1
0
        public void publishes_the_specification()
        {
            var s1 = new NugetSpec("Test1", "Test1.nuspec");

            var solution = new Solution();

            var service = MockRepository.GenerateStub<IPublishingService>();
            service.Stub(x => x.SpecificationsFor(solution)).Return(new[] { s1 });

            solution.UsePublisher(service);

            var version = SemanticVersion.Parse("1.1.2.3");
            var ctx = new PackageParams(s1, version, "artifacts", false);
            solution.Package(ctx);

            service.AssertWasCalled(x => x.CreatePackage(ctx));
        }
예제 #2
0
        public void retrieve_the_nuget_specs()
        {
            var s1 = new NugetSpec("Test1", "Test1.nuspec");
            var s2 = new NugetSpec("Test2", "Test2.nuspec");

            var solution = new Solution();

            var service = MockRepository.GenerateStub<IPublishingService>();
            service.Stub(x => x.SpecificationsFor(solution)).Return(new[] { s1, s2 });

            solution.UsePublisher(service);

            solution.Specifications.ShouldHaveTheSameElementsAs(s1, s2);
        }