コード例 #1
0
ファイル: ProgramTest.cs プロジェクト: okinta/agrix
        public void TestValidateInvalid()
        {
            var input = new LineInputter("what is this nonsense");

            Assert.Equal(1, AProgram.Main(_testAssembly, input.ReadLine,
                                          "validate", "--apikey", "abc"));
        }
コード例 #2
0
ファイル: ProgramTest.cs プロジェクト: okinta/agrix
        public void TestValidate()
        {
            var input = new LineInputter(Resources.TestPlatformConfig);

            Assert.Equal(0, AProgram.Main(_testAssembly, input.ReadLine,
                                          "validate", "--apiurl", "http://example.org/"));
        }
コード例 #3
0
ファイル: ProgramTest.cs プロジェクト: okinta/agrix
        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();
        }