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(); }
public void GivenAnEmptyQueue_WhenPushingNewUserToQueue_ThenPoppingUserShouldReturnThatUser() { var queue = new UserQueue(); queue.PushUserToQueue(Guid.NewGuid(), "Dan"); queue.PopUserFromQueue().Should().BeEquivalentTo("Dan"); }