コード例 #1
0
ファイル: Tests.cs プロジェクト: aomidi/Repository
        public void Standard()
        {
            var implicitKeyRepo = new FileSystemRepository <TestClass>(x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = "Tests/ImplicitKeyRepositories"
            });
            var typedRepo = new FileSystemRepository <TestClass, String>(x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = "Tests/TypedKeyRepositories"
            });
            var explicitKeyRepo = new ExplicitKeyFileSystemRepository <TestClass>(new FileSystemOptions <TestClass> {
                FolderPath = "Tests/ExplicitKeyRepositories"
            });

            StandardTests.All(implicitKeyRepo);
        }
コード例 #2
0
        public void Standard()
        {
            var implicitKeyRepo = new FileSystemRepository <TestClass>("Test", x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = "Tests/ImplicitKeyRepositories"
            });
            var gzipRepo = new FileSystemRepository <TestClass>("Test", x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = "Tests/ImplicitKeyRepositories", StreamGenerator = new GZipStreamGenerator(), FileExtension = ".txt.gz"
            });
            var explicitKeyRepo = new ExplicitKeyFileSystemRepository <TestClass>("Test", new FileSystemOptions <TestClass> {
                FolderPath = "Tests/ExplicitKeyRepositories"
            });

            StandardTests.All(implicitKeyRepo, null, explicitKeyRepo);
            StandardTests.All(gzipRepo);
        }
コード例 #3
0
        public void Standard()
        {
            var implicitKeyRepo = new FileSystemRepository <TestClass>("Test", x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = Path.Combine(basePath, "Tests/ImplicitKeyRepositories")
            });
            var gzipRepo = new FileSystemRepository <TestClass>("Test", x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = Path.Combine(basePath, "Tests/ImplicitKeyRepositories"), StreamGenerator = new GZipStreamGenerator(), FileExtension = ".txt.gz"
            });
            var explicitKeyRepo = new ExplicitKeyFileSystemRepository <TestClass>("Test", new FileSystemOptions <TestClass> {
                FolderPath = Path.Combine(basePath, "Tests/ExplicitKeyRepositories")
            });
            var multipleFileRepo = new FileSystemRepository <TestClass>("Test", x => x.ID, new FileSystemOptions <TestClass> {
                FolderPath = Path.Combine(basePath, "Tests/ImplicitKeyRepositories"), FileStorageType = FileStorageType.FilePerObject
            });

            StandardTests.All(implicitKeyRepo, null, explicitKeyRepo);
            StandardTests.All(gzipRepo);
            StandardTests.All(multipleFileRepo);
        }