integration tests
[teamcity/dotNetPackagesSupport.git] / nuget-tests / src / jetbrains / buildServer / nuget / tests / agent / NuGetPushActoinFactoryTest.java
index 7890935fbeda396d54053a1632cd0a5480d07077..b2c5a33c655294c56b334436fea3a48efd605c30 100644 (file)
@@ -68,10 +68,28 @@ public class NuGetPushActoinFactoryTest extends BaseTestCase {
       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
+      oneOf(myProcessFactory).executeCommandLine(ctx, myNuGet, Arrays.asList("push", myFile.getPath(), "api-key-guid", "-Source", "push-feed"), myFile.getParentFile());\r
     }});\r
 \r
     i.createPush(ctx, ps, myFile);\r
+\r
+    m.assertIsSatisfied();\r
+  }\r
+\r
+  @Test\r
+  public void test_command_push_no_source() 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(null));\r
+      allowing(ps).getCreateOnly(); will(returnValue(false));\r
+\r
+      oneOf(myProcessFactory).executeCommandLine(ctx, myNuGet, Arrays.asList("push", myFile.getPath(), "api-key-guid"), myFile.getParentFile());\r
+    }});\r
+\r
+    i.createPush(ctx, ps, myFile);\r
+\r
+    m.assertIsSatisfied();\r
   }\r
 \r
   @Test\r
@@ -82,10 +100,12 @@ public class NuGetPushActoinFactoryTest extends BaseTestCase {
       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
+      oneOf(myProcessFactory).executeCommandLine(ctx, myNuGet, Arrays.asList("push", myFile.getPath(), "api-key-guid", "-CreateOnly", "-Source", "push-feed"), myFile.getParentFile());\r
     }});\r
 \r
     i.createPush(ctx, ps, myFile);\r
+\r
+    m.assertIsSatisfied();\r
   }\r
 \r
 }\r