public void OpenLogFileWith(string fileName) { if (fileName == null) throw new ArgumentNullException("fileName"); var context = new FileLogProviderCreationContext(fileName); var provider = fileProviderFactory.CreateFor(context); if(context.WasCreated) { applicationController.Register(provider); } else { var command = new DisplayMessageCommand(context.CreationErrors); dialogLauncher.LaunchFor(command); } }
public void initializing_the_command_with_one_messasge_should_instantiate_the_command_with_the_given_message() { var expectedMessage = "Some message"; var command = new DisplayMessageCommand(expectedMessage); Assert.That(command.Message, Is.EqualTo(expectedMessage)); }
public void initializing_the_command_with_more_messages_should_instantiate_the_command_with_the_given_messages_seperated_with_a_new_line() { var command = new DisplayMessageCommand("Some message", "Another message"); Assert.That(command.Message, Is.EqualTo("Some message" + Environment.NewLine + "Another message")); }
public void should_display_an_error_dialog() { var command = new DisplayMessageCommand("An error occured"); var dialog = new DisplayMessageDialog(command); dialog.Show(); }