当前位置: 首页>>代码示例>>C#>>正文


C# RepositoryFactory.GetUserRepository方法代码示例

本文整理汇总了C#中RepositoryFactory.GetUserRepository方法的典型用法代码示例。如果您正苦于以下问题:C# RepositoryFactory.GetUserRepository方法的具体用法?C# RepositoryFactory.GetUserRepository怎么用?C# RepositoryFactory.GetUserRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RepositoryFactory的用法示例。


在下文中一共展示了RepositoryFactory.GetUserRepository方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

    public void Setup()
    {
        //RepositoryFactory is public... should that be the casE?
        //Uhh... crap, maybe that is okay because you would need to DLL to get it I believe
        //obivously it doesn't get exposed as part of the service. Well wtf am I so concerned about then...
        //well, stuff should be limited as much as possible
        //I'm able to hide the repos outside of the assembly, which forces the use of the factory
        //Its fine if the factory is public imo... use that to get all these repos, use those for testing
        //the data access layer part of the service
        //testing the Service Access layer should be easy... those methods should pretty much all be public or just use reflection

        repositoryFactory = new RepositoryFactory(configString);
        Assert.NotNull(repositoryFactory);

        userRepo = repositoryFactory.GetUserRepository(false);
        Assert.NotNull(userRepo);

        mockUserRepo = repositoryFactory.GetUserRepository(true); //This returns a test repo that doesn't hit the database
        Assert.NotNull(mockUserRepo);
        // Assert.IsInstanceOf(typeof(UserRepository), userRepo);
    }
开发者ID:jcbrock,项目名称:GameAssetService,代码行数:21,代码来源:UserTests.cs

示例2: Setup

    public void Setup()
    {
        repositoryFactory = new RepositoryFactory(configString);
        Assert.NotNull(repositoryFactory);

        userRepo = repositoryFactory.GetUserRepository(false);
        Assert.NotNull(userRepo);

        fileRepo = repositoryFactory.GetFileRepository(false); //Need to use the existing DataContext for this test already setup in UserRepository
        Assert.NotNull(fileRepo);

        downloadHistoryRepo = repositoryFactory.GetDownloadHistoryRepository(false); //Need to use the existing DataContext for this test already setup in UserRepository
        Assert.NotNull(downloadHistoryRepo);

        mockDownloadHistoryRepo = repositoryFactory.GetDownloadHistoryRepository(true); //This returns a test repo that doesn't hit the database
        Assert.NotNull(mockDownloadHistoryRepo);
    }
开发者ID:jcbrock,项目名称:GameAssetService,代码行数:17,代码来源:DownloadHistoryTests.cs


注:本文中的RepositoryFactory.GetUserRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。