Exemplo n.º 1
0
        public void TestExecuteFaildsNotCheckPublishStrict()
        {
            var file   = Helper.Fixtrue("Command/validate-failds.json");
            var tester = new TesterCommand(new CommandValidate());

            Assert.AreEqual(ExitCodes.ValidationWarning, tester.Execute($"--no-check-publish --strict {file}"));
        }
Exemplo n.º 2
0
        public void TestExecuteFaildsNotCheckPublish()
        {
            var file   = Helper.Fixtrue("Command/validate-failds.json");
            var tester = new TesterCommand(new CommandValidate());

            Assert.AreEqual(GameBox.Console.ExitCodes.Normal, tester.Execute($"--no-check-publish {file}"));
        }
Exemplo n.º 3
0
        public void TestExecuteWithFileArgumentRelative()
        {
            var tester = new TesterCommand(new CommandValidate());

            Assert.AreEqual(GameBox.Console.ExitCodes.Normal, tester.Execute("Fixtures/Command/validate-normal.json", AbstractTester.OptionDecorated(false)));
            StringAssert.Contains(tester.GetDisplay(), "Fixtures/Command/validate-normal.json is valid.");
        }
Exemplo n.º 4
0
        public void TestExecute()
        {
            var tester = new TesterCommand(new CommandValidate());

            Assert.AreEqual(ExitCodes.FileNotFoundException, tester.Execute());
            StringAssert.Contains(tester.GetDisplay(), "not found.");
        }
Exemplo n.º 5
0
        public void TestExecute()
        {
            var tester = new TesterCommand(new CommandAbout());

            Assert.AreEqual(ExitCodes.Normal, tester.Execute());
            StringAssert.Contains(
                tester.GetDisplay(), @"
Bucket - Package Dependency Manager
Bucket is a dependency manager tracking local dependencies of your projects and libraries.
See https://github.com/getbucket/bucket/wiki for more information.

");
        }
Exemplo n.º 6
0
        public void TestExecuteFailds()
        {
            var file   = Helper.Fixtrue("Command/validate-failds.json");
            var tester = new TesterCommand(new CommandValidate());

            Assert.AreEqual(ExitCodes.ValidationErrors, tester.Execute(file));

            var display = tester.GetDisplay();

            StringAssert.Contains(display, "strict errors that make it unable to be published as a package:");
            StringAssert.Contains(display, "bar, baz are required both in require and require-dev, this can lead to unexpected behavior.");
            StringAssert.Contains(display, "Name \"fooBarBaz\" does not match the best practice (e.g. lower-cased/with-dashes). We suggest using \"foo-bar-baz\" instead.");
            StringAssert.Contains(display, "It is recommended to add a provider name to the package (e.g. provide-name/package-name).");
        }
Exemplo n.º 7
0
        public void TestGetAllCapabilities(ConfigBucket bucket)
        {
            var package = new LoaderPackage().Load(bucket);

            pluginManager.ActivatePackages(package);

            var capabilities = pluginManager.GetAllCapabilities <ICommandProvider>(bucket, io);

            Assert.AreEqual(1, capabilities.Length);
            var command = capabilities[0].GetCommands().First();

            var testerCommand = new TesterCommand(command);

            Assert.AreEqual(ExitCodes.Normal, testerCommand.Execute());

            var display = testerCommand.GetDisplay();

            StringAssert.Contains(display, "Command foo");
        }