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());
            }
        }
Exemplo n.º 3
0
 public ZipFileRepository(AxinomZipContext context)
 {
     _context = context;
 }