コード例 #1
0
        public void Validate_WhenCustomerIsValid_NothingHappens()
        {
            //arrange
            var customer = new CustomerForTestsBuilder().Build();

            //act
            customer.Validate();

            //assert nothing
        }
コード例 #2
0
        public void Validate_WhenAddressIsNull_ThrowsInvalidCustomerException()
        {
            //arrange
            var customer = new CustomerForTestsBuilder().WithoutAddress().Build();

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

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