public void Setup() { _mockery = new MockRepository( ); _mockGateway = _mockery.DynamicMock <IDatabaseGateway>( ); _boatMapper = _mockery.DynamicMock <IBoatDataMapper>( ); _leaseDataMapper = _mockery.DynamicMock <ILeaseDataMapper>( ); _registrationMapper = _mockery.DynamicMock <IRegistrationDataMapper>( ); }
public CustomerDataMapper(IDatabaseGateway gateway, IBoatDataMapper boatMapper, ILeaseDataMapper leaseMapper, IRegistrationDataMapper registrationMapper) { _gateway = gateway; _boatMapper = boatMapper; _leaseMapper = leaseMapper; _registrationMapper = registrationMapper; }
public void Should_be_able_to_insert_new_leases_for_customer() { long customerId = CustomerMother.CreateCustomerRecord( ); IList <ISlipLease> leases = new List <ISlipLease>( ); leases.Add(new SlipLease(new Slip(1000, null, 100, 100, true), LeaseDurations.Daily)); ILeaseDataMapper mapper = CreateSUT( ); mapper.Insert(leases, customerId); IRichList <ISlipLease> foundLeases = ListFactory.From(mapper.AllLeasesFor(customerId)); Assert.AreEqual(1, foundLeases.Count); }
public DatabaseRowToSlipMapper(ILeaseDataMapper leaseDataMapper) { this.leaseDataMapper = leaseDataMapper; }