private static IEnumerable GetBlobReferenceDataSource()
        {
            var kernel = new RhinoMocksMockingKernel();
            var sourceItem1 = kernel.Get<ITaskItem>();
            sourceItem1.Stub(it => it.ItemSpec).Return("file1.txt");
            var sourceItem2 = kernel.Get<ITaskItem>();
            sourceItem2.Stub(it => it.ItemSpec).Return("file2.txt");
            var sourceFiles = new ITaskItem[] { sourceItem1, sourceItem2 };


            var destItem1 = kernel.Get<ITaskItem>();
            destItem1.Stub(it => it.ItemSpec).Return("prd\file1.txt");
            var destItem2 = kernel.Get<ITaskItem>();
            destItem2.Stub(it => it.ItemSpec).Return("prd\file2.txt");
            var destinationFiles = new ITaskItem[] { destItem1, destItem2 };

            yield return new TestCaseData(sourceFiles, destinationFiles);
        }
 private void BuildKernelForTest()
 {
     var kernel = new RhinoMocksMockingKernel(new NinjectSettings(), new DataModule(), new DomainModule());
     ObjectFactory.AssignKernel(kernel);
 }
        public void Setup()
        {
            kernel = new RhinoMocksMockingKernel();
            blobContainer = kernel.Get<IAzureBlobContainer>();
            logger = kernel.Get<ITaskLogger>();
            storageFactory = kernel.Get<IAzureBlobClientFactory>();
            blobClient = kernel.Get<IAzureBlobClient>();
            blob = kernel.Get<IAzureBlob>();
            fileManager = kernel.Get<IFileManager>();

            stream = new MemoryStream(Encoding.ASCII.GetBytes("this is a test stream \r\n this is a test stream"));

            blob.Stub(it => it.DeleteIfExists()).Return(true).Repeat.AtLeastOnce();
            storageFactory.Stub(it => it.Create(Arg<Uri>.Is.NotNull, Arg<string>.Is.NotNull, Arg<string>.Is.NotNull, Arg<int>.Is.Anything, Arg<int>.Is.Anything)).Return(blobClient);
            blobClient.Stub(it => it.GetContainerReference(Arg<string>.Is.NotNull)).Return(blobContainer);
            blobContainer.Stub(it => it.GetBlockBlobReference(Arg<string>.Is.NotNull)).Repeat.AtLeastOnce().Return(blob);
            fileManager.Stub(it => it.GetFile(Arg<string>.Is.NotNull)).Return(stream);

            task = kernel.Get<CopyToAzureStorage>();

            accountName = "accountName";
            accountKey = "accountKey";

            uri = "http://testuri.com";
            task.Endpoint = uri;
            task.StorageAccountName = accountName;
            task.StorageAccountKey = accountKey;
            task.ContainerName = "someContainer";
            task.SourceFiles = new ITaskItem[] { };
            task.DestinationFiles = new ITaskItem[] { };
        }