コード例 #1
0
ファイル: ExecutorTest.cs プロジェクト: 0install/0install-win
 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
ファイル: ExecutorTest.cs プロジェクト: 0install/0install-win
 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");
 }