Пример #1
0
 public Address(State state)
 {
     State = state;
 }
Пример #2
0
 public void IsEqualTo(State state)
 {
     Id.ShouldEqual(state.Id);
     Name.ShouldEqual(state.Name);
 }
Пример #3
0
        public void should_map_entities_with_components_to_data_transfer_objects_with_default_conventions()
        {
            var container = new Container(x => x.AddRegistry<EndToEndMappingRegistry>());
            var provider = container.GetInstance<IMappingProvider>();

            var texas = new State {Id = 1, Name = "Texas"};
            var billing = new Address(texas) {Id = 1, LineOne = "1234 Test Lane", LineTwo = "Apt 123", City = "Austin"};
            var shipping = new Address(texas) { Id = 1, LineOne = "345 Test Drive", LineTwo = "Suite 9000", City = "Austin" };
            var order = new Order
                            {
                                Id = 1000,
                                BillingAddress = billing,
                                ShippingAddress = shipping
                            };

            provider
                .Map<Order, OrderDto>(order)
                .IsEqualTo(order);
        }