public void TestValidateInvalid() { var input = new LineInputter("what is this nonsense"); Assert.Equal(1, AProgram.Main(_testAssembly, input.ReadLine, "validate", "--apikey", "abc")); }
public void TestValidate() { var input = new LineInputter(Resources.TestPlatformConfig); Assert.Equal(0, AProgram.Main(_testAssembly, input.ReadLine, "validate", "--apiurl", "http://example.org/")); }
public void TestProvisionDryrun() { const string expected = "plan.cpu=2&plan.memory=4096&plan.type=SSD&" + "os.name=Fedora%2032%20x64&os.app=Fedora%2032%20x64&" + "os.iso=&dryrun=True"; using var requests = new MockVultrRequests( new HttpHandler( "provision", expected, "")); var input = new LineInputter(Resources.TestPlatformConfig); Assert.Equal(0, AProgram.Main(_testAssembly, input.ReadLine, "provision", "--apiurl", requests.Url, "--dryrun")); requests.AssertAllCalledOnce(); }