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"); }
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"); }
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"); }
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"); }