Beispiel #1
0
        public IEnumerable <DisplayResponseLineDTO> AddNewBoatUsing(BoatRegistrationDTO boat)
        {
            ICustomer customer = _customers.FindBy(boat.CustomerId);

            customer.RegisterBoat(boat.RegistrationNumber,
                                  boat.Manufacturer,
                                  new DateTime(Convert.ToInt32(boat.ModelYear), 1, 1),
                                  Convert.ToInt64(boat.Length));
            _customers.Save(customer);
            return(new DisplayResponseLines("Success!"));
        }
        public void Should_leverage_task_to_submit_new_boat_registration()
        {
            IEnumerable <DisplayResponseLineDTO> response = ObjectMother.EnumerableDisplayResponseLineDTO( );
            BoatRegistrationDTO boat = ObjectMother.BoatRegistrationDTO( );

            using (mockery.Record( )) {
                SetupResult.For(mockMapper.MapFrom(mockRequest)).Return(boat);

                Expect.Call(mockTask.AddNewBoatUsing(boat)).Return(response);
            }

            using (mockery.Playback( )) {
                CreateSUT( ).SubmitRegistration( );
            }
        }
        public void Should_display_response_from_task_on_view()
        {
            IEnumerable <DisplayResponseLineDTO> response = ObjectMother.EnumerableDisplayResponseLineDTO( );
            BoatRegistrationDTO boat = ObjectMother.BoatRegistrationDTO( );

            using (mockery.Record( )) {
                SetupResult.For(mockMapper.MapFrom(mockRequest)).Return(boat);
                SetupResult.For(mockTask.AddNewBoatUsing(boat)).Return(response);

                mockView.Display(response);
            }

            using (mockery.Playback( )) {
                CreateSUT( ).SubmitRegistration( );
            }
        }
Beispiel #4
0
 public IEnumerable <DisplayResponseLineDTO> AddNewBoatUsing(BoatRegistrationDTO boat)
 {
     return(_underlyingTask.AddNewBoatUsing(boat));
 }