Inheritance: ProviderCreationContext
Esempio n. 1
0
 public void before_each()
 {
     dialogLauncher = MockRepository.GenerateMock<IDialogLauncher>();
     providerFactory = MockRepository.GenerateStub<ILogProviderFactory<FileLogProviderCreationContext>>();
     createdProvider = MockRepository.GenerateStub<ILogProvider>();
     applicationController = MockRepository.GenerateMock<IApplicationController>();
     context = new FileLogProviderCreationContext("log.txt");
 }
Esempio n. 2
0
 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);
     }
 }