public void Post_Throws_WhenMessageNull() { var entity = new QueueEntity("s"); Should.Throw <ArgumentNullException>(() => entity.Post(null)) .ParamName.ShouldBe("message"); }
public void Post_Throws_WhenObjectDisposed() { var entity = new QueueEntity("s"); entity.Dispose(); Should.Throw <ObjectDisposedException>(() => entity.Post(new Amqp.Message())); }
public void Post_CreatesEndEnqueuesDelivery() { var message = new Amqp.Message(); var entity = new QueueEntity("s"); IDelivery delivery = entity.Post(message); entity.ShouldSatisfyAllConditions( () => delivery.Message.ShouldBeSameAs(message), () => ((IEntity)entity).DeliveryQueue.Dequeue(CancellationToken.None).ShouldBeSameAs(message) ); }
public void Dispose_CanBeCalledMultipleTimes() { var entity = new QueueEntity("s"); entity.Post(new Amqp.Message()); Should.NotThrow(() => { entity.Dispose(); entity.Dispose(); entity.Dispose(); }); }