예제 #1
0
 public Recorder()
     : base()
 {
     HostInstance = this;
     this.OnBeforeNavigate += Recorder_OnBeforeNavigate;
     this.OnDownloadBegin += Recorder_OnDownloadBegin;
     this.OnDocumentComplete += Recorder_OnDocumentComplete2;
     this.OnDownloadComplete += Recorder_OnDownloadComplete;
     this.OnFileDownload += Recorder_OnFileDownload;
     this.OnFullScreen += Recorder_OnFullScreen;
     this.OnNavigateComplete += Recorder_OnNavigateComplete;
     this.OnNavigateError += Recorder_OnNavigateError;
 }
예제 #2
0
        public MainPage()
        {
            InitializeComponent();

            _recorder = new Recorder(new WaveFormat());
            _storage = IsolatedStorageFile.GetUserStoreForApplication();

            if (!_storage.DirectoryExists(STORAGE_DIRECTORY))
            {
                _storage.CreateDirectory(STORAGE_DIRECTORY);
            }

            UpdateRecordings();
        }
예제 #3
0
        public void Client_receives_no_notification_after_n_minus_one_events()
        {
            // Where
            int notificationLimit = 10;

            Recorder.Recorder recorder = createStubRecorder(notificationLimit);
            bool receievedNotification = false;

            recorder.RecorderEvents += (s, e) => { receievedNotification = true; };
            Recorder.Command command = new Recorder.Command(recorder);
            for (int i = 0; i < notificationLimit; i++)
            {
                command.Execute("value something" + i + " " + i);
            }
            // When
            // Then
            Assert.IsFalse(receievedNotification);
        }
예제 #4
0
        public void Client_receives_notification_after_invalid_event()
        {
            // Where
            Recorder.Recorder recorder   = createStubRecorder(2);
            bool   receievedNotification = false;
            string commandString         = "wrong command";

            recorder.RecorderEvents += (s, e) =>
            {
                receievedNotification = true;
                Assert.IsTrue(((Recorder.RecorderEventArgs)e).Message.EndsWith(commandString));
            };
            Recorder.Command command = new Recorder.Command(recorder);

            command.Execute(commandString);

            // When
            // Then
            Assert.IsTrue(receievedNotification);
        }