--- /dev/null
+/*\r
+ * Copyright 2000-2011 JetBrains s.r.o.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package jetbrains.buildServer.nuget.tests.server.feed.reader;\r
+\r
+import jetbrains.buildServer.BaseTestCase;\r
+import jetbrains.buildServer.nuget.server.feed.reader.impl.FeedGetMethodFactory;\r
+import jetbrains.buildServer.nuget.server.feed.reader.impl.Param;\r
+import org.apache.http.client.methods.HttpGet;\r
+import org.testng.Assert;\r
+import org.testng.annotations.BeforeMethod;\r
+import org.testng.annotations.Test;\r
+\r
+/**\r
+ * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * Date: 12.08.11 15:19\r
+ */\r
+public class FeedGetMethodFactoryTest extends BaseTestCase {\r
+ private FeedGetMethodFactory myFactory;\r
+\r
+\r
+ @BeforeMethod\r
+ @Override\r
+ protected void setUp() throws Exception {\r
+ super.setUp();\r
+ myFactory = new FeedGetMethodFactory();\r
+ }\r
+\r
+ @Test\r
+ public void test_emptyParams() {\r
+ final HttpGet get = myFactory.createGet("http://jetbrais.com");\r
+ Assert.assertEquals(get.getURI().toString(), "http://jetbrais.com");\r
+ }\r
+\r
+ @Test\r
+ public void test_withParams() {\r
+ final HttpGet get = myFactory.createGet("http://jetbrais.com?aaa=bbb");\r
+ Assert.assertEquals(get.getURI().toString(), "http://jetbrais.com?aaa=bbb");\r
+ }\r
+\r
+ @Test\r
+ public void test_withParams2() {\r
+ final HttpGet get = myFactory.createGet("http://jetbrais.com?aaa=bbb", new Param("qqq","ppp"));\r
+ Assert.assertEquals(get.getURI().toString(), "http://jetbrais.com?aaa=bbb&qqq=ppp");\r
+ }\r
+\r
+ @Test\r
+ public void test_withParams3() {\r
+ final HttpGet get = myFactory.createGet("http://jetbrais.com?aaa=bbb", new Param("qqq","ppp"), new Param("www","ttt"));\r
+ Assert.assertEquals(get.getURI().toString(), "http://jetbrais.com?aaa=bbb&qqq=ppp&www=ttt");\r
+ }\r
+\r
+ @Test\r
+ public void test_withParams4() {\r
+ final HttpGet get = myFactory.createGet("http://jetbrais.com", new Param("qqq","ppp"), new Param("www","ttt"));\r
+ Assert.assertEquals(get.getURI().toString(), "http://jetbrais.com?qqq=ppp&www=ttt");\r
+ }\r
+\r
+ @Test\r
+ public void test_withParams5() {\r
+ final HttpGet get = myFactory.createGet("http://jetbrais.com", new Param("$qqq","ppp"), new Param("$www","t t 't'"));\r
+ Assert.assertEquals(get.getURI().toString(), "http://jetbrais.com?%24qqq=ppp&%24www=t+t+%27t%27");\r
+ }\r
+}\r