Пример #1
0
        public void AzureBlobPakuStrategyUploadTest()
        {
            AzureBlobPakuStrategy strategy = new AzureBlobPakuStrategy();
            AzurePakuConfig       config   = JsonConvert.DeserializeObject <AzurePakuConfig>(File.ReadAllText(@"Props\azure.json"));

            File.WriteAllText("AzureBlobTest.txt", "test file");
            VirtualFileInfo        fi    = new VirtualFileInfo(new FileInfo("AzureBlobTest.txt"));
            List <VirtualFileInfo> files = new List <VirtualFileInfo>()
            {
                fi
            };

            strategy.Upload(config.ConnectionString, config.Container, files);
        }
Пример #2
0
        public void AzureBlobPakuStrategyTest()
        {
            // create test files
            List <VirtualFileInfo> files = new List <VirtualFileInfo>();

            for (int i = 0; i < 3; i++)
            {
                string fname = $"AzureBlobTest_{i}.txt";
                File.WriteAllText(fname, $"test file {i}");
                VirtualFileInfo fi = new VirtualFileInfo(new FileInfo(fname));
                files.Add(fi);
            }

            AzureBlobPakuStrategy strategy = new AzureBlobPakuStrategy();
            PakuResult            result   = strategy.Eat(new DirectoryInfo(Directory.GetCurrentDirectory()), files, @"Props\azure.json");

            Assert.IsTrue(result.Success);
            Assert.AreEqual(3, result.RemovedFiles.Count);
        }