示例#1
0
        public void StartProjectSetsCredentialsOnWebClient()
        {
            var url       = "http://*****:*****@test3";
            var webClient = mocks.Create <WebClient>().Object;

            SetupWebClient(webClient, url);
            var client = new CruiseServerHttpClient("http://*****:*****@test3", webClient);

            client.StartProject(null);

            Assert.IsNotNull(webClient.Credentials, "No credentials set");
            var cred = webClient.Credentials.GetCredential(new Uri(url), "Basic");

            Assert.AreEqual("test1", cred.UserName, "Unexpected username");
            Assert.AreEqual("test2", cred.Password, "Unexpected password");
        }
示例#2
0
        public void StartProjectSetsCredentialsOnWebClient()
        {
            var webClient = mocks.DynamicMock <WebClient>();

            SetupResult.For(webClient.Credentials).PropertyBehavior();
            var url    = "http://*****:*****@test3";
            var client = new CruiseServerHttpClient("http://*****:*****@test3", webClient);

            mocks.ReplayAll();
            client.StartProject(null);

            Assert.IsNotNull(webClient.Credentials, "No credentials set");
            var cred = webClient.Credentials.GetCredential(new Uri(url), "Basic");

            Assert.AreEqual("test1", cred.UserName, "Unexpected username");
            Assert.AreEqual("test2", cred.Password, "Unexpected password");
        }
        public void StartProjectSetsCredentialsOnWebClient()
        {
            var webClient = mocks.DynamicMock<WebClient>();
            SetupResult.For(webClient.Credentials).PropertyBehavior();
            var url = "http://*****:*****@test3";
            var client = new CruiseServerHttpClient("http://*****:*****@test3", webClient);

            mocks.ReplayAll();
            client.StartProject(null);

            Assert.IsNotNull(webClient.Credentials, "No credentials set");
            var cred = webClient.Credentials.GetCredential(new Uri(url), "Basic");
            Assert.AreEqual("test1", cred.UserName, "Unexpected username");
            Assert.AreEqual("test2", cred.Password, "Unexpected password");
        }