コード例 #1
0
        public void AppendToUriTest()
        {
            QueryStringParameters_Accessor target = new QueryStringParameters_Accessor();
              UriBuilder location = new UriBuilder(Constants.ApiBaseUrl);
              target.Add(Constants.QueryStringParam1, Constants.QueryStringValue1);
              target.Add(Constants.QueryStringParam1, Constants.QueryStringValue2);

              UriBuilder expected = location;
              expected.Query = string.Format("?{0}={1}&{2}={3}",
            Constants.QueryStringParam1,
            Constants.QueryStringValue1,
            Constants.QueryStringParam2,
            Constants.QueryStringValue2);

              UriBuilder actual = target.AppendToUri(location);
              Assert.AreEqual(expected, actual);
        }