Beispiel #1
0
        public void Execute_Throws_WhenProjectPathIsNotDefined()
        {
            ICreatioPkgProjectCreator creator = Substitute.For <ICreatioPkgProjectCreator>();
            ReferenceOptions          options = new ReferenceOptions();
            ReferenceCommand          command = new ReferenceCommand(creator);
            Action testAction = () => {
                command.Execute(options);
            };

            testAction.Should().Throw <Exception>();
        }
Beispiel #2
0
        public void Execute_SetsCorrectRef_WhenReferenceTypeIsUnitTestsSources()
        {
            ICreatioPkgProjectCreator creator = Substitute.For <ICreatioPkgProjectCreator>();
            ICreatioPkgProject        project = Substitute.For <ICreatioPkgProject>();

            creator.CreateFromFile(Arg.Any <string>()).Returns(project);
            ReferenceOptions options = new ReferenceOptions {
                Path          = "Testpath",
                ReferenceType = "unit-src"
            };
            ReferenceCommand command = new ReferenceCommand(creator);

            command.Execute(options);
            project.Received(1).RefToUnitCoreSrc();
        }
Beispiel #3
0
        public void Execute_SetsCustomRef_WhenReferenceTypeIsEmpty()
        {
            ICreatioPkgProjectCreator creator = Substitute.For <ICreatioPkgProjectCreator>();
            ICreatioPkgProject        project = Substitute.For <ICreatioPkgProject>();

            creator.CreateFromFile(Arg.Any <string>()).Returns(project);
            ReferenceOptions options = new ReferenceOptions {
                Path       = "Testpath",
                RefPattern = "TestPattern"
            };
            ReferenceCommand command = new ReferenceCommand(creator);

            command.Execute(options);
            project.Received(1).RefToCustomPath(options.RefPattern);
        }