Exemplo n.º 1
0
        public async Task GetNotes_Check()
        {
            //Arrange
            var hub = NotesHubFactory.GetHub();

            //Act
            var notes = await hub.GetNotesAsync();

            //Assert
            notes.Count().Should().Be(2);
        }
Exemplo n.º 2
0
        public async Task PutNote_Check()
        {
            //Arrange
            var hub = NotesHubFactory.GetHub();

            //Act
            await hub.PutNoteAsync(new NoteModel { Id = 3 });

            var notes = await hub.GetNotesAsync();

            //Assert
            notes.Count().Should().Be(3);
        }
Exemplo n.º 3
0
        public async Task DeleteNote_Check()
        {
            //Arrange
            var hub = NotesHubFactory.GetHub();

            //Act
            var notes = await hub.GetNotesAsync();

            await hub.DeleteNoteAsync(notes.First());

            notes = await hub.GetNotesAsync();

            //Assert
            notes.Count().Should().Be(1);
        }
Exemplo n.º 4
0
        public async Task UpdatedNote_Check()
        {
            //Arrange
            var hub   = NotesHubFactory.GetHub();
            var count = 0;

            hub.NoteStorageUpdate += (change, model) => count++;

            //Act
            var notes = await hub.GetNotesAsync();

            var json = notes.First().ToJson();
            await hub.HandleMessageAsync(json);

            //Assert
            count.Should().Be(1);
        }