public void AddOrderItem_WhenContentIsNull_MustThrowException()
        {
            // Arrange
            var subject = new OrderBuilder().Build();

            // Act
            TestDelegate action = () => subject.AddOrderItem(null, userId);

            // Assert
            Assert.That(action, Throws.ArgumentNullException
                        .With.Property("ParamName").EqualTo("content"));
        }
        public void AddOrderItem_WhenInvoked_MustAddOrderItemAddedEventWithOrderId()
        {
            // Arrange
            var subject = new OrderBuilder().Build();

            // Act
            subject.AddOrderItem("x", userId);

            // Assert
            var @event = subject.GetUncommitedChanges().Last() as OrderItemAdded;

            Assert.That(@event.OrderId, Is.EqualTo(subject.Id));
        }
        public void AddOrderItem_WhenInvoked_MustAddOrderItemWithUserId()
        {
            // Arrange
            var subject = new OrderBuilder().Build();

            // Act
            subject.AddOrderItem("x", userId);

            // Assert
            var orderItem = subject.Items.Single();

            Assert.That(orderItem.UserId, Is.EqualTo(userId));
        }
        public void AddOrderItem_WhenInvoked_MustAddOrderItemAddedEventWithContent()
        {
            // Arrange
            var content = "my order line2";
            var subject = new OrderBuilder().Build();

            // Act
            subject.AddOrderItem(content, userId);

            // Assert
            var @event = subject.GetUncommitedChanges().Last() as OrderItemAdded;

            Assert.That(@event.Content, Is.EqualTo(content));
        }
        public void AddOrderItem_WhenInvoked_MustAddOrderItemWithContent()
        {
            // Arrange
            var content = "my order line";
            var subject = new OrderBuilder().Build();

            // Act
            subject.AddOrderItem(content, userId);

            // Assert
            var orderItem = subject.Items.Single();

            Assert.That(orderItem.Content, Is.EqualTo(content));
        }