コード例 #1
0
        public void Should_create_report_from_parse_exception_when_content_is_null()
        {
            var fakeClipboard = A.Fake <ISystemClipboard>();
            var command       = new CopyErrorReportToClipboardCommand(fakeClipboard);

            command.Execute(new ParseException("Error message", null, null));

            A.CallTo(() => fakeClipboard.ReplaceWith(A <string> .That.Not.IsNullOrEmpty())).MustHaveHappened(Repeated.Exactly.Once);
        }
コード例 #2
0
        public void Should_create_report_from_empty_exception()
        {
            var fakeClipboard = A.Fake <ISystemClipboard>();
            var command       = new CopyErrorReportToClipboardCommand(fakeClipboard);

            command.Execute(new Exception());

            A.CallTo(() => fakeClipboard.ReplaceWith(A <string> .That.Not.IsNullOrEmpty())).MustHaveHappened(Repeated.Exactly.Once);
        }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: netconstructor/tomatoui
        private void InitializeMainWindow()
        {
            var settings = new Settings();

            var downlodReportCommand = new DownloadReportCommand(new ReportDownloader(), settings);

            var daily             = new DailyViewModel(downlodReportCommand);
            var monthly           = new MonthlyViewModel(downlodReportCommand);
            var settingsViewmodel = new SettingsViewModel(settings);

            var ignoreCommand    = new Command();
            var openUriCommand   = new OpenUriCommand();
            var clipboardCommand = new CopyErrorReportToClipboardCommand(new SystemClipboard());

            this.MainWindow = new MainWindow();

            this.MainWindow.DataContext = new MainViewModel(downlodReportCommand, ignoreCommand, openUriCommand, clipboardCommand, daily, monthly, settingsViewmodel);
        }