Пример #1
0
 public void TestExceptions()
 {
     var executor = new Executor(new Mock<IStore>(MockBehavior.Loose).Object);
     executor.Invoking(x => x.Start(new Selections {Command = Command.NameRun}))
         .ShouldThrow<ExecutorException>(because: "Selections with no implementations should be rejected");
     executor.Invoking(x => x.Start(new Selections {Implementations = {new ImplementationSelection()}}))
         .ShouldThrow<ExecutorException>(because: "Selections with no start command should be rejected");
 }
Пример #2
0
        public void TestExceptions()
        {
            var executor = new Executor(new Mock <IStore>(MockBehavior.Loose).Object);

            executor.Invoking(x => x.Start(new Selections {
                Command = Command.NameRun
            }))
            .ShouldThrow <ExecutorException>(because: "Selections with no implementations should be rejected");
            executor.Invoking(x => x.Start(new Selections {
                Implementations = { new ImplementationSelection() }
            }))
            .ShouldThrow <ExecutorException>(because: "Selections with no start command should be rejected");
        }
Пример #3
0
        private static void ExpectCommandException(Selections selections)
        {
            var storeMock = new Mock <IStore>(MockBehavior.Loose);

            storeMock.Setup(x => x.GetPath(It.IsAny <ManifestDigest>())).Returns("test path");
            var executor = new Executor(storeMock.Object);

            executor.Invoking(x => x.GetStartInfo(selections))
            .ShouldThrow <ExecutorException>(because: "Invalid Selections should be rejected");
        }
Пример #4
0
 private static void ExpectCommandException(Selections selections)
 {
     var storeMock = new Mock<IStore>(MockBehavior.Loose);
     storeMock.Setup(x => x.GetPath(It.IsAny<ManifestDigest>())).Returns("test path");
     var executor = new Executor(storeMock.Object);
     executor.Invoking(x => x.GetStartInfo(selections))
         .ShouldThrow<ExecutorException>(because: "Invalid Selections should be rejected");
 }