public async Task ThenTheNoteHasBeenPersisted(NotesFixture notesFixture) { var responseObject = notesFixture.NoteResponse; var response = await CallApi(responseObject.TargetId.ToString()).ConfigureAwait(false); var apiResult = await ExtractResultFromHttpResponse(response).ConfigureAwait(false); var note = apiResult.Results.FirstOrDefault(x => x.TargetId == responseObject.TargetId && x.Id == responseObject.Id); note.Should().NotBeNull(); note.Id.Should().Be(responseObject.Id); // Remove after use... var dbNote = new NoteDb() { Author = note.Author, Categorisation = note.Categorisation, CreatedAt = note.CreatedAt, Description = note.Description, Id = note.Id, TargetId = note.TargetId, TargetType = note.TargetType }; notesFixture.Notes.Add(dbNote); }
public async Task WhenPostingTheInvalidPayload(NotesFixture notesFixture) { var result = await PostJsonToApi(notesFixture.InvalidPayload).ConfigureAwait(false); notesFixture.NoteResponse = JsonConvert.DeserializeObject <NoteResponseObject>(result.Content.ReadAsStringAsync().Result); }
public PostNewNoteTests(DynamoDbIntegrationTests <Startup> dbFixture) { _dbFixture = dbFixture; _notesFixture = new NotesFixture(_dbFixture.DynamoDbContext); _steps = new PostNoteSteps(_dbFixture.Client); }
public GetNotesByTargetIdTests(DynamoDbIntegrationTests <Startup> dbFixture) { _dbFixture = dbFixture; _notesFixture = new NotesFixture(_dbFixture.DynamoDbContext); _steps = new GetNotesSteps(_dbFixture.Client); }