public override void before_each_spec() { var dependencyResolver = MockRepository.GenerateStub <IDependencyResolver>(); metaDataSynchroniser = MockRepository.GenerateStub <IMetaDataSynchroniser>(); fileSystemProvider = MockRepository.GenerateStub <IFileSystemProvider>(); packageBuilder = MockRepository.GenerateStub <IPackageCommand>(); var configReader = new BooBuildConfigReader(); dependencyResolver.Stub(x => x.Resolve <IBuildConfigReader>()).Return(configReader); dependencyResolver.Stub(x => x.Resolve <SVNSourceControl>()).Return( new SourceControlDouble("http://someurl.com/")); dependencyResolver.Stub(x => x.Resolve <IPackageCommand>("install")).Return(packageBuilder); fileSystemProvider.Stub(x => x.GetTemporaryBuildDirectory(Arg <DirectoryInfo> .Is.TypeOf)).Return( new DirectoryInfo(@"C:\temp\build")); IoC.InitializeWith(dependencyResolver); fileSystemProvider.Stub(x => x.GetHornRootDirectory(Arg <string> .Is.TypeOf)).Return(FileSystemHelper.GetFakeDummyHornDirectory()); fileSystemProvider.Stub(x => x.CreateTemporaryHornDirectory(Arg <string> .Is.TypeOf)).Return(new DirectoryInfo(HornConfig.Settings.HornTempDirectory)); fileSystemProvider.Stub(x => x.ZipFolder(Arg <DirectoryInfo> .Is.TypeOf, Arg <DirectoryInfo> .Is.TypeOf, Arg <string> .Is.TypeOf)).Return( new FileInfo(@"C:\zip")); siteStructureBuilder = GetSiteBuilder(); siteStructureBuilder.Initialise(); siteStructureBuilder.Build(); }
public override void before_each_spec() { var dependencyResolver = MockRepository.GenerateStub<IDependencyResolver>(); metaDataSynchroniser = MockRepository.GenerateStub<IMetaDataSynchroniser>(); fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>(); packageBuilder = MockRepository.GenerateStub<IPackageCommand>(); var configReader = new BooBuildConfigReader(); dependencyResolver.Stub(x => x.Resolve<IBuildConfigReader>()).Return(configReader); dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return( new SourceControlDouble("http://someurl.com/")); dependencyResolver.Stub(x => x.Resolve<IPackageCommand>("install")).Return(packageBuilder); fileSystemProvider.Stub(x => x.GetTemporaryBuildDirectory(Arg<DirectoryInfo>.Is.TypeOf)).Return( new DirectoryInfo(@"C:\temp\build")); IoC.InitializeWith(dependencyResolver); fileSystemProvider.Stub(x => x.GetHornRootDirectory(Arg<string>.Is.TypeOf)).Return(FileSystemHelper.GetFakeDummyHornDirectory()); fileSystemProvider.Stub(x => x.CreateTemporaryHornDirectory(Arg<string>.Is.TypeOf)).Return(new DirectoryInfo(HornConfig.Settings.HornTempDirectory)); fileSystemProvider.Stub(x => x.ZipFolder(Arg<DirectoryInfo>.Is.TypeOf, Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).Return( new FileInfo(@"C:\zip")); siteStructureBuilder = GetSiteBuilder(); siteStructureBuilder.Initialise(); siteStructureBuilder.Build(); }
public override void before_each_spec() { var dependencyResolver = MockRepository.GenerateStub <IDependencyResolver>(); fileSystemProvider = MockRepository.GenerateStub <IFileSystemProvider>(); packageBuilder = MockRepository.GenerateStub <IPackageCommand>(); rootPackageTree = MockRepository.GenerateStub <IPackageTree>(); buildMetaData = MockRepository.GenerateStub <IBuildMetaData>(); commandArgs = new CommandArgs("horn", false, null, false, null); dependencyResolver.Stub(x => x.HasComponent <ICommandArgs>()).Return(true); dependencyResolver.Stub(x => x.Resolve <ICommandArgs>()).Return(commandArgs); dependencyResolver.Stub(x => x.Resolve <IPackageCommand>("install") ).Return(packageBuilder); IoC.InitializeWith(dependencyResolver); rootPackageTree.Stub(x => x.Result).Return(new DirectoryInfo(@"z:\horn")); buildMetaData.ProjectInfo = new Dictionary <string, object>(); rootPackageTree.Stub(x => x.GetAllPackageMetaData()).Return(new List <IBuildMetaData> { buildMetaData }); rootPackageTree.Stub(x => x.Name).Return("horn"); var category = new Category(null, rootPackageTree); fileSystemProvider.Stub(x => x.GetFiles(Arg <DirectoryInfo> .Is.TypeOf, Arg <string> .Is.TypeOf)).Return( new List <FileInfo> { new FileInfo(string.Format("horn-{0}.zip", new DateTime(2009, 10, 30).ToString(FileSystemProvider.FileDateFormat))), new FileInfo(string.Format("horn-{0}.zip", new DateTime(2009, 10, 29).ToString(FileSystemProvider.FileDateFormat))), new FileInfo(string.Format("horn-{0}.zip", new DateTime(2009, 10, 31).ToString(FileSystemProvider.FileDateFormat))) }.ToArray()); package = new PackageDouble(category, buildMetaData); string zipFileName = string.Format("{0}-{1}.zip", package.Name, DateTime.Now.ToString(FileSystemProvider.FileDateFormat)); fileSystemProvider.Stub( x => x.ZipFolder(Arg <DirectoryInfo> .Is.TypeOf, Arg <DirectoryInfo> .Is.TypeOf, Arg <string> .Is.TypeOf)). Return(new FileInfo(zipFileName)); }
public override void before_each_spec() { var dependencyResolver = MockRepository.GenerateStub<IDependencyResolver>(); fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>(); packageBuilder = MockRepository.GenerateStub<IPackageCommand>(); rootPackageTree = MockRepository.GenerateStub<IPackageTree>(); buildMetaData = MockRepository.GenerateStub<IBuildMetaData>(); commandArgs = new CommandArgs("horn", false, null, false, null); dependencyResolver.Stub(x => x.HasComponent<ICommandArgs>()).Return(true); dependencyResolver.Stub(x => x.Resolve<ICommandArgs>()).Return(commandArgs); dependencyResolver.Stub(x => x.Resolve<IPackageCommand>("install") ).Return(packageBuilder); IoC.InitializeWith(dependencyResolver); rootPackageTree.Stub(x => x.Result).Return(new DirectoryInfo(@"z:\horn")); buildMetaData.ProjectInfo= new Dictionary<string, object>(); rootPackageTree.Stub(x => x.GetAllPackageMetaData()).Return(new List<IBuildMetaData> {buildMetaData}); rootPackageTree.Stub(x => x.Name).Return("horn"); var category = new Category(null, rootPackageTree); fileSystemProvider.Stub(x => x.GetFiles(Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).Return( new List<FileInfo> { new FileInfo(string.Format("horn-{0}.zip", new DateTime(2009, 10, 30).ToString(FileSystemProvider.FileDateFormat))), new FileInfo(string.Format("horn-{0}.zip", new DateTime(2009, 10, 29).ToString(FileSystemProvider.FileDateFormat))), new FileInfo(string.Format("horn-{0}.zip", new DateTime(2009, 10, 31).ToString(FileSystemProvider.FileDateFormat))) }.ToArray()); package = new PackageDouble(category, buildMetaData); string zipFileName = string.Format("{0}-{1}.zip", package.Name, DateTime.Now.ToString(FileSystemProvider.FileDateFormat)); fileSystemProvider.Stub( x => x.ZipFolder(Arg<DirectoryInfo>.Is.TypeOf, Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)). Return(new FileInfo(zipFileName)); }
public AiringService(IGetAiringQuery airingQueryHelper, AppSettings appSettings, IAiringSaveCommand airingSaveCommandHelper, IAiringDeleteCommand airingDeleteCommandHelper, IAiringMessagePusher airingMessagePusherCommandHelper, IQueueQuery queueQueryHelper, ITaskUpdater taskUpdaterCommand, IFileQuery fileQueryHelper, IDestinationQuery destinationQueryHelper, IPackageQuery packageQueryHelper, IChangeHistoricalAiringQuery changeHistoricalAiringQueryHelper, IChangeDeletedAiringQuery changeDeletedAiringQueryHelper, IDeportExpiredAiring deportExpiredAiringHelper, CurrentAiringsQuery currentAiringsQuery, DeletedAiringsQuery deletedAiringsQuery, IUpdateDeletedAiringQueueDelivery updateDeletedAiringQueueDelivery, IUpdateAiringQueueDelivery updateAiringQueueDelivery, IPackageCommand packagePersist, IPurgeAiringCommand purgeAiringCommand, IChangeNotificationCommands changeNotificaitonCommands, IApplicationContext cntx ) { this.airingQueryHelper = airingQueryHelper; this.airingSaveCommandHelper = airingSaveCommandHelper; this.airingDeleteCommandHelper = airingDeleteCommandHelper; this.airingMessagePusherCommandHelper = airingMessagePusherCommandHelper; this.queueQueryHelper = queueQueryHelper; this.taskUpdaterCommand = taskUpdaterCommand; this.fileQueryHelper = fileQueryHelper; this.appSettings = appSettings; this.destinationQueryHelper = destinationQueryHelper; this.packageQueryHelper = packageQueryHelper; this.changeHistoricalAiringQueryHelper = changeHistoricalAiringQueryHelper; this.changeDeletedAiringQueryHelper = changeDeletedAiringQueryHelper; this.deportExpiredAiringHelper = deportExpiredAiringHelper; this.currentAiringsQuery = currentAiringsQuery; this.deletedAiringsQuery = deletedAiringsQuery; this.updateAiringQueueDelivery = updateAiringQueueDelivery; this.updateDeletedAiringQueueDelivery = updateDeletedAiringQueueDelivery; this.packagePersist = packagePersist; this.purgeAiringCommand = purgeAiringCommand; this.changeNotificationCommand = changeNotificaitonCommands; this.cntx = cntx; }
public PackageService(IPackageCommand packagePersist, IPackageQuery packageQuery, IApplicationContext cntx) { this.packagePersist = packagePersist; this.packageQuery = packageQuery; this.cntx = cntx; }