Esempio n. 1
0
        public void SetAlias_invalid_alias_no_action_taken(string value)
        {
            var options = new GetGitChangeDirectoryCommandOptions {
                NameOrAlias = "ShouldntMatter", Alias = value
            };
            var testCmd = new ActionSetAlias(_repoPaths, options, _hitManager);

            Assert.AreEqual(options.NameOrAlias, testCmd.TargetName);

            testCmd.Process(_info);

            _hitManager.Received(0).GetHitList();
        }
Esempio n. 2
0
        public void Existing_entry_set_new_alias()
        {
            var hitData      = GcdTestHelper.BuildFakeHitData(true);
            var expectedData = hitData.First();

            var options = new GetGitChangeDirectoryCommandOptions {
                NameOrAlias = expectedData.Alias, Alias = "Surge"
            };

            var testCmd = new ActionSetAlias(_repoPaths, options, _hitManager);

            Assert.AreEqual(options.NameOrAlias, testCmd.TargetName);
            _hitManager.GetHitList().Returns(hitData);

            testCmd.Process(_info);

            _hitManager.Received(1).GetHitList();
            _hitManager.Received(1).SetAlias(expectedData.Directory, options.Alias);
        }