public static async Task TestCase( this MeetupClient @this, Func <MeetupClient, Task <HttpResponseMessage> > command, Action <HttpResponseMessage> assertResponse = null, Action <Meetup> assert = null) { assert = assert ?? (_ => { }); var response = await command(@this); assertResponse(response); await @this.Get(id); }
public async Task Meetup_Create_Test() { var meetupId = Guid.NewGuid(); var title = "EventSourcing CQRS"; var location = "Seattle, Redmond, Microsoft"; await _client.Create(meetupId, title, location); var meetup = await _client.Get(meetupId); Assert.Equal(meetupId, meetup.MeetupId); Assert.Equal(location, meetup.Location); Assert.Equal(title, meetup.Title); Assert.Equal(Meetup.MeetupState.Created, meetup.State); }
public static async Task <Meetup> Get(this MeetupClient @this) => await @this.Get(id);