コード例 #1
0
        public CustomerForTestsBuilder()
        {
            var fixture = new Fixture();

            _addressBuilder  = new AddressForTestsBuilder();
            _withAddress     = true;
            _name            = fixture.Create <string>();
            _surName         = fixture.Create <string>();
            _telephoneNumber = fixture.Create <string>();
        }
コード例 #2
0
        public void Validate_StreetNameIsNull_ThrowsInvalidAddressException()
        {
            //arange
            var address = new AddressForTestsBuilder().WithoutStreetName().Build();

            //act
            var exception = Record.Exception(() => address.Validate());

            //assert
            Assert.IsType <AddressInvalidException>(exception);
        }