public void Given_No_Errors_Expect_Null_Error_Object() { //---------------Arrange------------------- var presenter = new ErrorOnlyPropertyPresenter <ErrorOutput>(); //---------------Act------------------- presenter.Respond(); //---------------Assert------------------- presenter.Output.Should().BeNull(); }
public void Given_Errors_Expect_Non_Null_Error_Object() { //---------------Arrange------------------- var errors = new ErrorOutput(); errors.AddError("Test error 1"); errors.AddError("Test error 2"); var presenter = new ErrorOnlyPropertyPresenter <ErrorOutput>(); //---------------Act------------------- presenter.Respond(errors); //---------------Assert------------------- presenter.Output.Should().NotBeNull(); }
public void Start() { var arguments = Build_Arguments(); var exePath = Get_Exe_Path(); _action = new BackgroundAction(new InfluxDbServerTask(exePath, arguments)); var presenter = new ErrorOnlyPropertyPresenter <ErrorOutput>(); _action.Start(presenter); if (presenter.Output != null && presenter.Output.HasErrors) { throw new InfluxServerStartException($"Failed to start InfluxDb because of [{string.Join(",", presenter.Output.Errors)}]"); } }