示例#1
0
 public void Setup()
 {
     _transactionScope  = new TransactionScope();
     _zipFileRepository = new ZipFileRepository(ConfigurationManager.ConnectionStrings["Unity"].ConnectionString);
     _manCoRepository   = new ManCoRepository(ConfigurationManager.ConnectionStrings["Unity"].ConnectionString);
     _manCo             = BuildMeA.ManCo("description", "code");
     _manCo2            = BuildMeA.ManCo("description2", "code2");
     _manCo3            = BuildMeA.ManCo("description3", "code3");
 }
        public async Task Should_Add_New_FileStructure()
        {
            optionsBuilder.UseInMemoryDatabase("MySuperTestDb");

            // Run the test against one instance of the context
            using (var context = new AxinomZipContext(optionsBuilder.Options))
            {
                var zipFileRepository = new ZipFileRepository(context);
                var zipFile           = new ZipFile {
                    Name = "python vedios", FolderStructure = "python vedios"
                };
                await zipFileRepository.Add(zipFile);

                Assert.True(zipFile.Id > 0);
            }
        }
        public async Task Should_Return_Two_As_FileStructure_List_Count()
        {
            optionsBuilder.UseInMemoryDatabase("MySuperTestDb");

            // Run the test against one instance of the context
            using (var context = new AxinomZipContext(optionsBuilder.Options))
            {
                var zipFileRepository = new ZipFileRepository(context);
                var zipFile1          = new ZipFile {
                    Name = "xamarin.forms", FolderStructure = "xamarin.forms"
                };
                var zipFile2 = new ZipFile {
                    Name = "python vedios", FolderStructure = "python vedios"
                };
                await zipFileRepository.Add(zipFile1);

                await zipFileRepository.Add(zipFile2);

                Assert.Equal(2, context.ZipFiles.Count());
            }
        }
示例#4
0
 public FileService(ZipFileRepository zipFileRepository)
 {
     _zipFileRepository = zipFileRepository;
 }