コード例 #1
0
ファイル: HomeController.cs プロジェクト: chenderong/Blog
 public HomeController(BlogService blogService, UserService userService, CategoryService categoryService,
                       OpenSourceService openSourceService, BlogCommentService blogCommentService,
                       NewsService newsService,
                       IOptions <WebStaticConfig> options) : base(options)
 {
     this._blogService        = blogService;
     this._userService        = userService;
     this._categoryService    = categoryService;
     this._openSourceService  = openSourceService;
     this._blogCommentService = blogCommentService;
     this._newsService        = newsService;
 }
コード例 #2
0
        //ToDo: Start WebDev.WebServer.exe before the tests are run in TestSetup then delete this test
        public void SanityTest()
        {
            var service = new OpenSourceService();

            try
            {
                service.GetProjectsByUsernameXml(ProjectHost.GitHub.ToString(), "AdamDotCom");
            }
            catch (Exception)
            {
                Assert.Fail("WebDev.WebServer.exe (cassini) probably isn't running, try starting up the ServiceHost project.");
            }
        }
コード例 #3
0
        //ToDo: Start WebDev.WebServer.exe before the tests are run in TestSetup then delete this test
        public void SanityTest()
        {
            var service = new OpenSourceService();

            try
            {
                service.GetProjectsByUsernameXml(ProjectHost.GitHub.ToString(), "AdamDotCom");
            }
            catch(Exception)
            {
                Assert.Fail("WebDev.WebServer.exe (cassini) probably isn't running, try starting up the ServiceHost project.");
            }
        }
コード例 #4
0
        public void ShouldVerifyProxyAndGetGetProjectsByProjectHostAndUsernameXml()
        {
            var service = new OpenSourceService();

            var resultsXml = service.GetProjectsByProjectHostAndUsernameXml("github:adamdotcom,googlecode:adam.kahtava.com", null);

            Assert.IsNotNull(resultsXml);
            Assert.Greater(resultsXml.Count, 1);

            var resultsJson = service.GetProjectsByProjectHostAndUsernameJson("github:adamdotcom,googlecode:adam.kahtava.com", null);

            Assert.IsNotNull(resultsJson);
            Assert.Greater(resultsJson.Count, 1);
        }
コード例 #5
0
        public void ShouldVerifyProxyAndGetProjectsByUsername()
        {
            var service = new OpenSourceService();

            var resultsXml = service.GetProjectsByUsernameXml(ProjectHost.GitHub.ToString(), "AdamDotCom");

            Assert.IsNotNull(resultsXml);
            Assert.Greater(resultsXml.Count, 1);

            var resultsJson = service.GetProjectsByUsernameJson(ProjectHost.GoogleCode.ToString(), "adam.kahtava.com");

            Assert.IsNotNull(resultsJson);
            Assert.Greater(resultsXml.Count, 1);
        }
コード例 #6
0
        public void ShouldVerifyProxyAndGetGetProjectsByProjectHostAndUsernameXml()
        {
            var service = new OpenSourceService();

            var resultsXml = service.GetProjectsByProjectHostAndUsernameXml("github:adamdotcom,googlecode:adam.kahtava.com", null);

            Assert.IsNotNull(resultsXml);
            Assert.Greater(resultsXml.Count, 1);

            var resultsJson = service.GetProjectsByProjectHostAndUsernameJson("github:adamdotcom,googlecode:adam.kahtava.com", null);

            Assert.IsNotNull(resultsJson);
            Assert.Greater(resultsJson.Count, 1);
        }
コード例 #7
0
        public void ShouldVerifyProxyAndGetProjectsByUsername()
        {
            var service = new OpenSourceService();

            var resultsXml = service.GetProjectsByUsernameXml(ProjectHost.GitHub.ToString(), "AdamDotCom");

            Assert.IsNotNull(resultsXml);
            Assert.Greater(resultsXml.Count, 1);
            
            var resultsJson = service.GetProjectsByUsernameJson(ProjectHost.GoogleCode.ToString(), "adam.kahtava.com");

            Assert.IsNotNull(resultsJson);
            Assert.Greater(resultsXml.Count, 1);
        }
コード例 #8
0
        public void ShouldVerifyProxyAndThrowException()
        {
            var service = new OpenSourceService();

            service.GetProjectsByUsernameXml(ProjectHost.Unknown.ToString(), "AdamDotCom");
        }
コード例 #9
0
 public OpenSourceController(OpenSourceService openSourceService)
 {
     this._openSourceService = openSourceService;
 }
コード例 #10
0
 public OpenSourceController(OpenSourceService openSourceService, UserService userService, IOptions <WebStaticConfig> options)
 {
     this._openSourceServic = openSourceService;
     this._userService      = userService;
     this._webStaticConfig  = options.Value;
 }
コード例 #11
0
        public void ShouldVerifyProxyAndThrowException()
        {
            var service = new OpenSourceService();

            service.GetProjectsByUsernameXml(ProjectHost.Unknown.ToString(), "AdamDotCom");
        }