public void GetListFromCredentials_ThrowsWhenListNotPossible()
        {
            var credentials = new Dictionary <string, Credential>()
            {
                { "foo", new Credential()
                  {
                      { "bar", new Credential()
                        {
                            { "bang", new Credential("badabing") }
                        } },
                  } }
            };
            Tags   tags   = new Tags(new string[] { "foo", "bar" });
            string scheme = "scheme";

            var sif = new TestServiceInfoFactory(tags, scheme);
            var ex  = Assert.Throws <ConnectorException>(() => sif.GetListFromCredentials(credentials, "foo"));

            Assert.Contains("key=foo", ex.Message);
            Assert.Contains("value=bar/", ex.Message);
        }
        public void GetListFromCredentials_ReturnsCorrect()
        {
            var credentials = new Dictionary <string, Credential>()
            {
                { "uris", new Credential()
                  {
                      { "0", new Credential("http://foo:11") },
                      { "1", new Credential("http://bar:11") }
                  } }
            };
            Tags   tags   = new Tags(new string[] { "foo", "bar" });
            string scheme = "scheme";

            var sif  = new TestServiceInfoFactory(tags, scheme);
            var list = sif.GetListFromCredentials(credentials, "uris");

            Assert.NotNull(list);
            Assert.Equal(2, list.Count);
            Assert.True(list[0].Equals("http://foo:11") || list[0].Equals("http://bar:11"));
            Assert.True(list[1].Equals("http://foo:11") || list[1].Equals("http://bar:11"));
        }