示例#1
0
        public async Task Attendants_Test()
        {
            var meetupId      = Guid.NewGuid();
            var title         = "EventSourcing CQRS";
            var location      = "Seattle, Redmond, Microsoft";
            var numberOfSeats = 2;
            var jon           = Guid.NewGuid();
            var carla         = Guid.NewGuid();
            var susan         = Guid.NewGuid();

            await _client.Create(meetupId, title, location);

            await _client.UpdateSeats(meetupId, numberOfSeats);

            await _client.Publish(meetupId);

            await _client.AcceptRSVP(meetupId, jon, DateTime.UtcNow);

            await _client.AcceptRSVP(meetupId, carla, DateTime.UtcNow.AddSeconds(1));

            await _client.AcceptRSVP(meetupId, susan, DateTime.UtcNow.AddSeconds(1));

            var attendants = await _client.GetAttendants(meetupId);

            attendants.Going.AssertEqual(jon, carla);
            attendants.Waiting.AssertEqual(susan);
            Assert.Empty(attendants.NotGoing);
        }
        public static async Task <HttpResponseMessage> Published(this MeetupClient @this)
        {
            await @this.Create();

            await @this.UpdateLocation();

            await @this.UpdateSeats();

            await @this.UpdateTime();

            return(await @this.Publish());
        }
示例#3
0
        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 Task <HttpResponseMessage> Create(this MeetupClient @this)
 {
     id = Guid.NewGuid();
     return(@this.Create(id, title));
 }