public void FromEntity_Should_Return_An_EmptyObject_When_Given_An_EmptyEntity()
        {
            CustomerCart sut = new CustomerCart();

            // Act
            var mut = sut.FromEntity(null);

            //
            //mut.ShouldBe(new CartDto(), $"Should be given an empty [{nameof(CartDto)}]");
        }
示例#2
0
        public CartDto GetCustomerCart(string userId)
        {
            // transformation in services
            // business logic

            // etc
            var entity = _cartsRepository.GetSingleCart(userId);

            return(_customerCart.FromEntity(entity));
        }