コード例 #1
0
        public static IProjectService Create(IProjectServices services = null)
        {
            var mock = new Mock <IProjectService>();

            services = services ?? IProjectServicesFactory.Create(projectService: mock.Object);

            mock.Setup(p => p.Services)
            .Returns(services);

            return(mock.Object);
        }
コード例 #2
0
        public static IProjectCommonServices ImplementThreadingPolicy(IProjectThreadingService threadingPolicy)
        {
            var services       = IProjectServicesFactory.Create(threadingPolicy);
            var projectService = IProjectServiceFactory.Create(services);

            var mock = new Mock <IProjectCommonServices>();

            mock.SetupGet(s => s.ProjectService)
            .Returns(projectService);

            return(mock.Object);
        }