public void GivenAnEmptyQueue_WhenPushingTwoUsersToQueue_ThenPoppingUserShouldReturnFirstUser() { var queue = new UserQueue(); queue.PushUserToQueue(Guid.NewGuid(), "Dan"); queue.PushUserToQueue(Guid.NewGuid(), "Bob"); queue.PopUserFromQueue().Should().BeEquivalentTo("Dan"); }
public void GivenAQueueWithThreeUsers_EnsureExpectedOrderWhenPopping() { var queue = new UserQueue(); queue.PushUserToQueue(Guid.NewGuid(), "Dan"); queue.PushUserToQueue(Guid.NewGuid(), "Bob"); queue.PushUserToQueue(Guid.NewGuid(), "Fred"); queue.PopUserFromQueue().Should().BeEquivalentTo("Dan"); queue.PopUserFromQueue().Should().BeEquivalentTo("Bob"); queue.PopUserFromQueue().Should().BeEquivalentTo("Fred"); queue.PopUserFromQueue().Should().BeNull(); }