コード例 #1
0
        public void LoadAddress_WhenAddressIdDoesNotExist_ShouldThrowException()
        {
            _currentContact = new FakeCurrentContact(Enumerable.Empty <CustomerAddress>());
            var customerContext = new FakeCustomerContext(_currentContact);
            var countryManager  = new FakeCountryManager();

            _subject = new AddressBookService(customerContext, countryManager);

            var model = new Address();

            model.AddressId = Guid.NewGuid();
            _subject.LoadAddress(model);
        }
コード例 #2
0
        public void Setup()
        {
            _address1           = CustomerAddress.CreateInstance();
            _address1.AddressId = new PrimaryKeyId(Guid.NewGuid());
            _address1.Name      = _address1.AddressId.ToString();

            _address2           = CustomerAddress.CreateInstance();
            _address2.AddressId = new PrimaryKeyId(Guid.NewGuid());
            _address2.Name      = _address2.AddressId.ToString();

            _currentContact = new FakeCurrentContact(new[] { _address1, _address2 });
            var customerContext = new FakeCustomerContext(_currentContact);
            var countryManager  = new FakeCountryManager();

            _subject = new AddressBookService(customerContext, countryManager);
        }
コード例 #3
0
        public AddressBookServiceTests()
        {
            _address1           = CustomerAddress.CreateInstance();
            _address1.AddressId = new PrimaryKeyId(new Guid(_address1Id));
            _address1.Name      = _address1.AddressId.ToString();

            var address2 = CustomerAddress.CreateInstance();

            address2.AddressId = new PrimaryKeyId(new Guid(_address2Id));
            address2.Name      = address2.AddressId.ToString();

            _currentContact = new FakeCurrentContact(new[] { _address1, address2 })
            {
                PreferredBillingAddress  = _address1,
                PreferredShippingAddress = _address1
            };
            var customerContext = new FakeCustomerContext(_currentContact);
            var countryManager  = new FakeCountryManager();

            _subject = new AddressBookService(customerContext, countryManager, new Mock <IOrderFactory>().Object);
        }