Esempio n. 1
0
        public void Deployer_can_be_constructed(ConsoleAppTestInput consoleAppTestInput, ExpectedData expectedData)
        {
            // ---------- setup -----------
            _testTools.SetupTFiles(consoleAppTestInput.Files);
            var args = _testTools.ReplacePlaceholders2(consoleAppTestInput.Args).Split(' ');

            if (!_argumentHandler.SetInputParam(args))
            {
                Assert.Fail(_argumentHandler.ExceptionThrown.Message);
            }

            // ----------- test ------------
            var deployer = new Deployer(_argumentHandler);

            Assert.NotNull(deployer);

            Assert.That(deployer.ProjectRoot, Is.EqualTo(_testTools.ReplacePlaceholders(expectedData.ProjectRoot)));
            Assert.That(deployer.ProjectName, Is.EqualTo(_testTools.ReplacePlaceholders(expectedData.ProjectName)));
        }
Esempio n. 2
0
        public void Deployer_throw_LaravelProjectRootNotFoundException(ConsoleAppTestInput consoleAppTestInput, ExpectedData expectedData)
        {
            // ---------- setup -----------
            _testTools.SetupTFiles(consoleAppTestInput.Files);
            _argumentHandler.SetInputParam(_testTools.ReplacePlaceholders2(consoleAppTestInput.Args).Split(' '));

            // ---------- test -----------
            var exception = Assert.Throws <LaravelProjectRootNotFoundException>(delegate {
                var unused = new Deployer(_argumentHandler);
            });

            Assert.That(exception.Code(), Is.EqualTo(LaravelProjectRootNotFoundException.Code));
        }