more tests on push command
[teamcity/dotNetPackagesSupport.git] / nuget-tests / src / jetbrains / buildServer / nuget / tests / agent / NuGetPushActoinFactoryTest.java
index 782939ba6356a38bd43bf896d9df04bde34582c5..7890935fbeda396d54053a1632cd0a5480d07077 100644 (file)
@@ -66,6 +66,7 @@ public class NuGetPushActoinFactoryTest extends BaseTestCase {
       allowing(ps).getNuGetExeFile(); will(returnValue(myNuGet));\r
       allowing(ps).getApiKey(); will(returnValue("api-key-guid"));\r
       allowing(ps).getPublishSource(); will(returnValue("push-feed"));\r
+      allowing(ps).getCreateOnly(); will(returnValue(false));\r
 \r
       oneOf(myProcessFactory).executeCommandLine(ctx, myNuGet, Arrays.asList(myFile.getPath(), "api-key-guid", "-Source", "push-feed"), myFile.getParentFile());\r
     }});\r
@@ -73,4 +74,18 @@ public class NuGetPushActoinFactoryTest extends BaseTestCase {
     i.createPush(ctx, ps, myFile);\r
   }\r
 \r
+  @Test\r
+  public void test_command_push_no_pacakge() throws RunBuildException {\r
+    m.checking(new Expectations(){{\r
+      allowing(ps).getNuGetExeFile(); will(returnValue(myNuGet));\r
+      allowing(ps).getApiKey(); will(returnValue("api-key-guid"));\r
+      allowing(ps).getPublishSource(); will(returnValue("push-feed"));\r
+      allowing(ps).getCreateOnly(); will(returnValue(true));\r
+\r
+      oneOf(myProcessFactory).executeCommandLine(ctx, myNuGet, Arrays.asList(myFile.getPath(), "api-key-guid", "-CreateOnly", "-Source", "push-feed"), myFile.getParentFile());\r
+    }});\r
+\r
+    i.createPush(ctx, ps, myFile);\r
+  }\r
+\r
 }\r